Skip to content

Show descriptive errors when view event fails (actual error not showing up) #670

Open
@x00

Description

@x00

Testing on android 6.01 (pure) Moto X Play

[ro.build.version.sdk]: [23]

say you have in your template

<Label text="test event" (tap)="testEvent()"></Label>

and in your code the method

private testEvent() : void {
    throw Error("This error will not show up");
}

when the click on it the error that will show up will be

An uncaught Exception occurred on "main" thread.
com.tns.NativeScriptException: 
Calling js method onTouch failed

which is not all that helpful

the work around

private testEvent() : void {
    try {
        throw Error("This error will show up");
    } catch(e) {
        console.log((<Error>e).message);
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions