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

PanicInfo get message in rust stable? #57638

Closed
andreeaflorescu opened this issue Jan 15, 2019 · 2 comments
Closed

PanicInfo get message in rust stable? #57638

andreeaflorescu opened this issue Jan 15, 2019 · 2 comments
Labels
T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Comments

@andreeaflorescu
Copy link

Hey, I was wondering if there is any plan in having the method message from PanicInfo available in rust stable. The documentation points to an issue that is closed (#44489).

Related to the following issues in Firecracker:

Is there another recommended way to get the panic information? I was also thinking about replacing the panic_hook with catch_unwind but we might get into problems if the external crates that we are using are implementing panic with abort.

@memoryruins memoryruins added the T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. label Jan 16, 2019
@hellow554
Copy link
Contributor

hellow554 commented Jan 16, 2019

IIRC PanicInfo implement Display which means you can either do println!("{}", panicinfo) or let info = panicinfo.to_string(). I guess message will be removed therefore.

edit: Display does indeed print the message but will prepend some text (https://doc.rust-lang.org/1.29.0/src/core/panic.rs.html#136), you might be able to remove that?! Not sure though.

@andreeaflorescu
Copy link
Author

I can hack my way around this. Thanks for the response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants