Skip to content

Commit

Permalink
Improve error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
webmaster128 committed Jun 10, 2020
1 parent 08e7334 commit d03e152
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/vm/src/memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ pub fn read_region(ctx: &Ctx, ptr: u32, max_length: usize) -> VmResult<Vec<u8>>
Ok(result)
}
None => Err(CommunicationError::deref_err(region.offset, format!(
"Error dereferencing region {:?} in wasm memory of size {}. This typically happens when the given pointer does not point to a Region struct.",
"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."
region,
memory.size().bytes().0
)).into()),
Expand Down Expand Up @@ -126,7 +126,7 @@ pub fn write_region(ctx: &Ctx, ptr: u32, data: &[u8]) -> VmResult<()> {
Ok(())
},
None => Err(CommunicationError::deref_err(region.offset, format!(
"Error dereferencing region {:?} in wasm memory of size {}. This typically happens when the given pointer does not point to a Region struct.",
"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."
region,
memory.size().bytes().0
)).into()),
Expand Down

0 comments on commit d03e152

Please sign in to comment.