diff --git a/src/memory.rs b/src/memory.rs index 385f5d0..f9d3cfc 100644 --- a/src/memory.rs +++ b/src/memory.rs @@ -113,13 +113,17 @@ impl MemoryInstance { let initial_u32: u32 = initial .0 .try_into() - .map_err(|_| Error::Memory("initial can't be coerced to u32".into()))?; + .map_err(|_| Error::Memory(format!("initial ({}) can't be coerced to u32", initial.0)))?; let maximum_u32: Option = match maximum { - Some(pages) => Some( - pages + Some(maximum_pages) => Some( + maximum_pages .0 .try_into() - .map_err(|_| Error::Memory("maximum can't be coerced to u32".into()))?, + .map_err(|_| + Error::Memory( + format!("maximum ({}) can't be coerced to u32", maximum_pages.0) + ) + )?, ), None => None, };