framework icon indicating copy to clipboard operation
framework copied to clipboard

better error logging

Open MikeKovarik opened this issue 5 years ago • 1 comments

I'm submitting a feature request

  • Library Version: aurelia-script 1.3.1

Current behavior: If you make a typo, or on this case I forgot to add async to a function, you get a long but useless stacktrace pointing to inside of aurelia but nowhere in the stack trace does it give me any clue of what view, class, file is at fault. I've had this issue for years, ever since Aurelia was still in beta and it's been my biggest problem with aurelia ever since. Because despite having .developmentLogging() enabled I'm subjected to tearing my app down and uncommenting it line by line until I find the needle in the haystack

image

Expected Behavior: Some general information about origin of the error - the file, line, or a class/method

MikeKovarik avatar Mar 09 '19 10:03 MikeKovarik

@MikeKovarik thanks for filing this.

The error you got is SyntaxError, so first thing to do would have been looking for ... syntax error. The reason why it got so long stack is because that module is loaded by Aurelia Router, via dynamic import() api, as I see you are using aurelia-script there. That said, there's thing we can improve in the router, such as checking error, if it's SyntaxError, log a message to give some hint how to debug it, before rethrowing it, if it makes sense.

cc @EisenbergEffect

bigopon avatar Mar 09 '19 11:03 bigopon