GithubHelp home page GithubHelp logo

Comments (3)

spatney avatar spatney commented on July 18, 2024

It does, you can either put a try-catch around it, or a method decorator like below to make this easy to re-use.

module powerbi.extensibility.visual {
    export function logExceptions() {
        return function (target: any, key: string, value: any) {
            return {
                value: function () {
                    let p = window.performance.now();
                    let result;
                    try {
                        result = value.value.apply(this, arguments);
                    } catch (e) {
                        console.error(e);
                        throw e;
                    }
                    return result;
                }
            }
        }
    }
}

and use it like below on the method you would like to log exceptions for.

@logExceptions()
public update(options: VisualUpdateOptions) {

We'll probably add a module for helpers like these soon enough.

from powerbi-visuals-tools.

itslenny avatar itslenny commented on July 18, 2024

Thanks for pointing this out, @Knagis

There are a few techniques you can use for debugging your visual. I've added a page to the docs to explain them all: Debugging Guide

from powerbi-visuals-tools.

Knagis avatar Knagis commented on July 18, 2024

This only handles the cases when the error is caused by code directly called from the visual. In this case the decorator approach would work.

However, if I use a library that uses setTimeout or requestAnimationFrame and fails there, the error would still be lost. Perhaps there is a way to get all errors logged by the host to be shown in the console. Even if that shows way too much information it would allow to quickly check if there are any errors when something seems not to be working. The break on caught exceptions is the minimum solution however it sometimes produces way too much noise. edit: seems to be not true

from powerbi-visuals-tools.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.