Remove some custom error types in Wasmtime (#5347)
* Remove some custom error types in Wasmtime These types are mostly cumbersome to work with nowadays that `anyhow` is used everywhere else. This commit removes `InstantiationError` and `SetupError` in favor of using `anyhow::Error` throughout. This can eventually culminate in creation of specific errors for embedders to downcast to but for now this should be general enough. * Fix Windows build
This commit is contained in:
@@ -253,7 +253,7 @@ fn test_initial_memory_limits_exceeded() -> Result<()> {
|
||||
Ok(_) => unreachable!(),
|
||||
Err(e) => assert_eq!(
|
||||
e.to_string(),
|
||||
"Insufficient resources: memory minimum size of 11 pages exceeds memory limits"
|
||||
"memory minimum size of 11 pages exceeds memory limits"
|
||||
),
|
||||
}
|
||||
|
||||
@@ -261,7 +261,7 @@ fn test_initial_memory_limits_exceeded() -> Result<()> {
|
||||
Ok(_) => unreachable!(),
|
||||
Err(e) => assert_eq!(
|
||||
e.to_string(),
|
||||
"Insufficient resources: memory minimum size of 25 pages exceeds memory limits"
|
||||
"memory minimum size of 25 pages exceeds memory limits"
|
||||
),
|
||||
}
|
||||
|
||||
@@ -329,7 +329,7 @@ fn test_initial_table_limits_exceeded() -> Result<()> {
|
||||
Ok(_) => unreachable!(),
|
||||
Err(e) => assert_eq!(
|
||||
e.to_string(),
|
||||
"Insufficient resources: table minimum size of 23 elements exceeds table limits"
|
||||
"table minimum size of 23 elements exceeds table limits"
|
||||
),
|
||||
}
|
||||
|
||||
@@ -341,7 +341,7 @@ fn test_initial_table_limits_exceeded() -> Result<()> {
|
||||
Ok(_) => unreachable!(),
|
||||
Err(e) => assert_eq!(
|
||||
e.to_string(),
|
||||
"Insufficient resources: table minimum size of 99 elements exceeds table limits"
|
||||
"table minimum size of 99 elements exceeds table limits"
|
||||
),
|
||||
}
|
||||
|
||||
@@ -374,7 +374,7 @@ fn test_pooling_allocator_initial_limits_exceeded() -> Result<()> {
|
||||
Ok(_) => unreachable!(),
|
||||
Err(e) => assert_eq!(
|
||||
e.to_string(),
|
||||
"Insufficient resources: memory minimum size of 5 pages exceeds memory limits"
|
||||
"memory minimum size of 5 pages exceeds memory limits"
|
||||
),
|
||||
}
|
||||
|
||||
|
||||
@@ -428,7 +428,7 @@ fn instantiation_limit() -> Result<()> {
|
||||
Err(e) => assert_eq!(
|
||||
e.to_string(),
|
||||
format!(
|
||||
"Limit of {} concurrent instances has been reached",
|
||||
"maximum concurrent instance limit of {} reached",
|
||||
INSTANCE_LIMIT
|
||||
)
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user