aya/maps: improve map errors to be more descriptive

pull/89/head
William Findlay 3 years ago
parent 17b730c717
commit 27d803b634
No known key found for this signature in database
GPG Key ID: 7162B44E9E560373

@ -88,17 +88,19 @@ pub enum MapError {
#[error("the map `{name}` has already been pinned")] #[error("the map `{name}` has already been pinned")]
AlreadyPinned { name: String }, AlreadyPinned { name: String },
#[error("failed to create map `{name}`: {code}")] #[error("failed to create map `{name}` with code {code}")]
CreateError { CreateError {
name: String, name: String,
code: libc::c_long, code: libc::c_long,
#[source]
io_error: io::Error, io_error: io::Error,
}, },
#[error("failed to pin map `{name}`: {code}")] #[error("failed to pin map `{name}` with code {code}")]
PinError { PinError {
name: String, name: String,
code: libc::c_long, code: libc::c_long,
#[source]
io_error: io::Error, io_error: io::Error,
}, },
@ -120,10 +122,11 @@ pub enum MapError {
#[error("the program is not loaded")] #[error("the program is not loaded")]
ProgramNotLoaded, ProgramNotLoaded,
#[error("the `{call}` syscall failed with code {code} io_error {io_error}")] #[error("the `{call}` syscall failed with code {code}")]
SyscallError { SyscallError {
call: String, call: String,
code: libc::c_long, code: libc::c_long,
#[source]
io_error: io::Error, io_error: io::Error,
}, },

Loading…
Cancel
Save