-
Notifications
You must be signed in to change notification settings - Fork 821
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
Standard exception types for singlepass backend. #1129
Conversation
bors try |
tryBuild succeeded
|
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.
Thanks for adding more comments in the code!
The code looks good to me.
lib/runtime-core/src/error.rs
Outdated
@@ -208,6 +209,8 @@ impl std::fmt::Display for RuntimeError { | |||
write!(f, "\"{}\"", s) | |||
} else if let Some(s) = data.downcast_ref::<&str>() { | |||
write!(f, "\"{}\"", s) | |||
} else if let Some(exc_code) = data.downcast_ref::<ExceptionCode>() { | |||
write!(f, "\"{:?}\"", exc_code) |
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.
Maybe we should write it is an exception code, so that the user has more insight than the variant name. My suggestion:
write!(f, "exception code \"{:?}\"", exc_code)
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.
Thanks! Fixed and now the error message looks like Error: RuntimeError: Caught exception of type "Arithmetic".
.
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.
This looks really good. Thank you!!
The goal was to fix some of the spectests that are excluded from singlepass due to not failing "the right way". I don't see any updates to excludes.txt. Are those fixed?
@nlewycky I just updated By the way, I think it would be good to refactor |
bors r+ |
Build failed |
bors r+ |
bors r- |
Canceled |
bors r+ |
Build succeeded
|
Great job! I have a small question: why these traps are |
No description provided.