mirror of
https://github.com/fluencelabs/wasmer
synced 2025-06-13 00:51:20 +00:00
Return link error instead of assertion failure for bad data initialization
This commit is contained in:
@ -80,6 +80,9 @@ pub enum LinkError {
|
||||
expected: GlobalDescriptor,
|
||||
found: GlobalDescriptor,
|
||||
},
|
||||
Generic {
|
||||
message: String,
|
||||
},
|
||||
}
|
||||
|
||||
impl PartialEq for LinkError {
|
||||
@ -107,6 +110,9 @@ impl std::fmt::Display for LinkError {
|
||||
LinkError::IncorrectTableDescriptor{namespace, name,expected,found} => {
|
||||
write!(f, "Incorrect table descriptor, namespace: {}, name: {}, expected table descriptor: {:?}, found table descriptor: {:?}", namespace, name, expected, found)
|
||||
},
|
||||
LinkError::Generic { message } => {
|
||||
write!(f, "{}", message)
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user