mirror of
https://github.com/fluencelabs/wasmer
synced 2025-04-01 15:31:04 +00:00
feat(interface-types) Add the NegativeValue
instruction error.
This commit is contained in:
parent
f3be7981d2
commit
25cd6cd24a
@ -149,6 +149,12 @@ pub enum InstructionErrorKind {
|
|||||||
|
|
||||||
/// The string contains invalid UTF-8 encoding.
|
/// The string contains invalid UTF-8 encoding.
|
||||||
String(string::FromUtf8Error),
|
String(string::FromUtf8Error),
|
||||||
|
|
||||||
|
/// A negative value isn't allowed (like a negative pointer value).
|
||||||
|
NegativeValue {
|
||||||
|
/// The variable name that triggered the error.
|
||||||
|
subject: &'static str,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Error for InstructionErrorKind {}
|
impl Error for InstructionErrorKind {}
|
||||||
@ -227,6 +233,12 @@ impl Display for InstructionErrorKind {
|
|||||||
"{}",
|
"{}",
|
||||||
error
|
error
|
||||||
),
|
),
|
||||||
|
|
||||||
|
Self::NegativeValue { subject } => write!(
|
||||||
|
formatter,
|
||||||
|
"read the value of `{}` which must be positive",
|
||||||
|
subject
|
||||||
|
),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user