-
Notifications
You must be signed in to change notification settings - Fork 1.6k
[Feature] Improved Panic Handling #2927
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
base: staging
Are you sure you want to change the base?
Changes from all commits
a1b8685
f75afa0
b4e4bee
c5f8957
c24332f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -34,9 +34,6 @@ pub use bytes::*; | |
| pub mod defer; | ||
| pub use defer::*; | ||
|
|
||
| mod vm_error; | ||
| pub use vm_error::*; | ||
|
|
||
| pub mod iterator; | ||
| pub use iterator::*; | ||
|
|
||
|
|
@@ -58,5 +55,24 @@ pub use serialize::*; | |
| pub mod errors; | ||
| pub use errors::*; | ||
|
|
||
| #[cfg(feature = "async")] | ||
| /// Helpers to spawn async tasks. | ||
| pub mod task; | ||
| #[cfg(feature = "async")] | ||
| pub use task::*; | ||
|
|
||
| /// Use old name for backward-compatibility. | ||
| pub use errors::io_error as error; | ||
|
|
||
| /// This macro provides a VM runtime environment which will safely halt | ||
| /// without producing logs that look like unexpected behavior. | ||
| /// In debug mode, it prints to stderr using the format: "VM safely halted at {location}: {halt message}". | ||
| /// | ||
| /// It is more efficient to set the panic hook once and directly use `errors::try_vm_runtime`. | ||
| #[macro_export] | ||
| macro_rules! try_vm_runtime { | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't all the finalize instances still call the macro This would call
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I clarified the documentation that it is safe to call It would be great if we could replace that macro eventually, but that would require users of snarkVM to call |
||
| ($e:expr) => {{ | ||
| $crate::errors::set_panic_hook(); | ||
| $crate::errors::try_vm_runtime($e) | ||
| }}; | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.