pico-engine icon indicating copy to clipboard operation
pico-engine copied to clipboard

Better error reporting for compiled code

Open farskipper opened this issue 7 years ago • 4 comments

Catch JS errors in compiled code and use source-maps to get the KRL line and excerpt

i.e. calling a function that is not defined, or having a "native" module throw an error

farskipper avatar Mar 06 '17 20:03 farskipper

example, this function which calls filter without passing in a function: vehicles = function() { Subscriptions:getSubscriptions().filter(v,k){ v{"attributes"}{"subscriber_role"} == "vehicle" } }

b1conrad avatar Mar 31 '17 19:03 b1conrad

Once this work begins, I think it should be labeled 'Ongoing' rather than 'Working', at least until this can be split into more specific issues.

0joshuaolson1 avatar Aug 09 '17 16:08 0joshuaolson1

The standard library has better error reporting now (with even better planned). Library modules are next. One remaining scope is user-defined modules.

0joshuaolson1 avatar Sep 27 '17 17:09 0joshuaolson1

As of 0.43 the compiler emits line/col specific error messages. There are more compiler checks that can be added.

The runtime error handling should use source-maps to point to the location in the krl source file.

farskipper avatar Dec 11 '17 17:12 farskipper