Closed Slugger closed 4 years ago
No problems at all mate, this is now done.
Changed Debug level to Error level for any error except for 'function not implemented', and it will now include the entire exception stacktrace. It'll be up in the next release <3
Confirmed working. I was hoping it would print a stacktrace of my JS code instead of a stacktrace of the C# invoker. But either way, it is dumping a stacktrace.
No problems mate, I'm now catching JavaScriptException, and so far got it to the point of :
2020-06-17 22:38:49.432 Error Emby ScripterX: Package Javascript Error (8b91c4d0-66f2-47c8-9471-ae9c741d6b6f): 'ReferenceError: deliberate_error is not defined' on line 69 of C:\Users\Anthony\AppData\Roaming\Emby-Server\programdata\data/ScripterX/Packages/8b91c4d0-66f2-47c8-9471-ae9c741d6b6f/Package.js. Data:
Just looking at what else it provides that would be useful and then I'll include it in the release :)
Describe the bug When an event handler fails, the error is only logged at the debug level. Errors are properly caught, but they should be logged at the error level so they are always present without the need for debug logging being turned on. I had a subtle syntax error in some js I was testing with and couldn't figure out why I wasn't seeing anything happening. Once I enabled debug logging, ScripterX printed out an error that lead me to my problem.
I don't know if JInt provides full stacktraces itself, but if it does, it would be great to log that along with the exception error message.
To Reproduce Steps to reproduce the behavior:
Expected behavior When an error is caught, log it at error level instead of debug level so errors are always present in the log file to help with troubleshooting.
Screenshots n/a
Desktop (please complete the following information): n/a
Smartphone (please complete the following information): n/a