Throwing Error in JavaScript file causes unhandled exception in Log with Jackson parser
Is there an existing issue for this?
- [X] I have searched the existing issues and didn't find mine.
Steps to reproduce
- Create JS file that will perform some action.
- Add
throw new Error("message")command. - Error might be the single action in the JavaScript file to simplify reproducing
- Call this JS file from a test
On failure, the maestro log with have Jackson parser exception.
So, there is no error message from the Error that will help to understand why the test failed, just a useless unhandled exception.
Actual results
Unhandled exception in Jackson parser
Expected results
The message from error is displayed in the log file
About app
Any natove mobile app. Failure may happen before starting the app, if my script is creating test data before the test.
About environment
macOS 14.6.1 java 17.0.11 2024-04-16 LTS
Logs
Logs
[ERROR] maestro.cli.report.TestDebugReporter - Unable to parse commands
com.fasterxml.jackson.databind.JsonMappingException: org.mozilla.javascript.NativeObject cannot be cast to org.mozilla.javascript.NativeError (through reference chain: java.util.ArrayList[2]->maestro.cli.report.CommandDebugWrapper["metadata"]->maestro.cli.report.CommandDebugMetadata["error"]->org.mozilla.javascript.JavaScriptException["value"]->org.mozilla.javascript.NativeError["prototype"]->org.mozilla.javascript.NativeError["stackDelegated"])
Maestro version
14.6.1
How did you install Maestro?
Homebrew
Anything else?
No response
Hey @mikamikaWolt, thanks for reporting this.
Just to make sure: Would you expect a throw new Error("message") in JavaScript to fail the currently executing flow?
Came looking for this error.
Ideally a few things would happen:
- Log to the console
- Fail the test and stop processing commands
- Reduce the amount of noise in the logs (I've attached an example)
Without additional information, we can't resolve this issue. We're therefore reluctantly going to close it.
Feel free to open a new issue with all the required information provided, including a minimal, reproducible sample. When creating a new issue, please make sure to diligently fill out the issue template.
Thank you for your contribution to our open-source community!
@bartekpacia Reopen please