Skip to content

Commit d03e152

Browse files
committed
Improve error messages
1 parent 08e7334 commit d03e152

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/vm/src/memory.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ pub fn read_region(ctx: &Ctx, ptr: u32, max_length: usize) -> VmResult<Vec<u8>>
8484
Ok(result)
8585
}
8686
None => Err(CommunicationError::deref_err(region.offset, format!(
87-
"Error dereferencing region {:?} in wasm memory of size {}. This typically happens when the given pointer does not point to a Region struct.",
87+
"Tried to access memory of region {:?} in wasm memory of size {} bytes. This typically happens when the given Region pointer does not point to a proper Region struct."
8888
region,
8989
memory.size().bytes().0
9090
)).into()),
@@ -126,7 +126,7 @@ pub fn write_region(ctx: &Ctx, ptr: u32, data: &[u8]) -> VmResult<()> {
126126
Ok(())
127127
},
128128
None => Err(CommunicationError::deref_err(region.offset, format!(
129-
"Error dereferencing region {:?} in wasm memory of size {}. This typically happens when the given pointer does not point to a Region struct.",
129+
"Tried to access memory of region {:?} in wasm memory of size {} bytes. This typically happens when the given Region pointer does not point to a proper Region struct."
130130
region,
131131
memory.size().bytes().0
132132
)).into()),

0 commit comments

Comments
 (0)