-
Notifications
You must be signed in to change notification settings - Fork 615
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
Set StageError cause in ChiselStage #1382
Conversation
Signed-off-by: Schuyler Eldridge <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks ok. Should there be a test to illustrate?
Looks good to me as well. One thing I was wondering, instead of Perhaps then we can use normal |
Unfortunately, this by itself, isn't sufficient.
which eventually gets converted into another zero information exception in
|
@ucbjrl I think we should reconsider how we compose things and update those places to not catch Errors. As described in the Java documentation: "An Error is a subclass of Throwable that indicates serious problems that a reasonable application should not try to catch." |
Perhaps it's time to revisit #361? |
Good catch, @ucbjrl. I expect the Hot take: the sooner we can remove |
Actually, @ucbjrl: I think what's happening is the correct behavior of stack trace trimming:
Even though (4) happens, the information is still provided to the user. This is, as far as I can tell, how #931 was intended to work. The contract of @jackkoenig has suggested that stack trace trimming should instead directly manipulate the stack trace. This may be a better approach. Perhaps we should implement something like this instead? |
Right, the problem is the failure isn't available programmatically (without some contortions). Chisel is a library and may not always be the top application. One could argue that we shouldn't be printing errors without some negotiation with/advice from the enclosing application. |
Printing generally isn't great, imagine if there's bug in I think there's general agreement about finding a more composable solution, the real question is if we should do this for |
Hot take 2️⃣: We're late enough on 3.3, let's just fix it. (I volunteer...) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, lgtm
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Change
ChiselStage
to set the cause of aStageError
due to aChiselException
to be theChiselException
. This should fix issues where libraries that want to inspect the stack trace can do so. Previously, this would do stack trace trimming and drop a no-causeStageError
.Related issue: #1114 (comment)
Type of change: bug report
Impact: no functional change
Development Phase: implementation