Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

swap order that errors are raised when auto-running fails #219

Conversation

EdwardLarson
Copy link
Collaborator

the component's error is now at the bottom of the stack trace, so the user sees it first

One sentence summary of this PR (This should go in the CHANGELOG!)
Tweak how errors are raised when auto-running components, so the actual root cause is not buried

Link to Related Issue(s)
If a component is auto-run (which is common, every analyze or unpack are auto-runs for example) and it raises an error E, then the job service also generates it's own error F with info about why the component was chosen by the auto-run. Previously the errors were raised as raise F from E, which resulted in the stack trace printing error info in the order:

E
F

So what a user sees most obviously is some junk about the auto-run, and the root cause is buried halfway up. This also translates to the GUI when there is a backend error: Since F is the most proximate error, that auto-run info error is the one shown in a pop-up when there is a backend error.

Please describe the changes in your request.
Do raise E from F instead, so errors are printed in the order:

F
E

And the most recent stuff printed is about the root cause that the user cares about. The info about why the component was selected is still there, if it will be useful for debugging.

Anyone you think should look at this, specifically?

…nent's error is now at the bottom of the stack trace, so the user sees it first
@EdwardLarson
Copy link
Collaborator Author

As an example of the effect in the GUI, here's how an error is displayed before and after this PR:
Screen Shot 2023-02-09 at 1 37 14 PM
Screen Shot 2023-02-09 at 1 45 22 PM

@rbs-jacob
Copy link
Member

I like that this is a fairly simple fix that will have a major usability impact! Both in the GUI and for API users working at the command line.

@EdwardLarson EdwardLarson merged commit bec3849 into redballoonsecurity:master Feb 9, 2023
marczalik pushed a commit to marczalik/ofrak that referenced this pull request Feb 14, 2023
…security#219)

* swap order that errors are raised when auto-running fails - the component's error is now at the bottom of the stack trace, so the user sees it first

* update changelog

---------

Co-authored-by: edward <edward@redballoonsecurity.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants