firecracker icon indicating copy to clipboard operation
firecracker copied to clipboard

Implement Debug & Display for Errors that can generate panics

Open andreeaflorescu opened this issue 6 years ago • 5 comments

We currently don't get a nice panic message as the errors on which we use unwrap or the format! macro do not have a custom implementation for Display and Debug.

The errors that I identified so far that should have Display/Debug implemented are the following:

  • [ ] Error from vmm/src/lib.rs
  • [ ] Error from api/src/lib.rs

For the API errors, instead of printing the io::Error with format we should do something like io_err.kind().to_string(). The nice thing it does is that instead of having a errno, we will get a nice string like: "permission denied" for errno=13.

andreeaflorescu avatar Jan 16 '19 15:01 andreeaflorescu

@andreeaflorescu Can I take this up? For this do we want both Display and Debug traits to be implemented only for errors used in panics or for all of them?

fristonio avatar Feb 03 '19 23:02 fristonio

Debug is needed for errors that generate panics (Error enum in api server and Error enum in vmm). Display is needed for errors that end up at the external user (via responses to an API request). We already added trait implementations for some of them (mostly in the vmm crate) but it will need a bit of research to see if there are any other errors that can cause panics.

The one that really really bugs me and doesn't have a fix yet is the API error AddrInUse. That is an error that generates common panics because the api socket was not deleted before re-runing firecracker. The panic message is also not very helpful.

Feel free to take the task and let me know if you need help with anything.

andreeaflorescu avatar Feb 04 '19 14:02 andreeaflorescu

Ok, I will start working on this then. Will ping you on slack if I have some doubt :)

fristonio avatar Feb 04 '19 18:02 fristonio

hello @andreeaflorescu is this still open ? if it doesnt move, please assign to me

0xkelvin avatar Mar 16 '23 16:03 0xkelvin

@JBYoshi and I would like to work on this. We're doing a class project for UT Austin's virtualization class, where we're supposed to work on issues in virtualization-related open source projects. Is this issue open for us to work on?

sarimaleem avatar Mar 24 '23 07:03 sarimaleem