@@ -127,7 +127,7 @@ impl ExceptionTableBuilder {
127127 & mut self ,
128128 start_offset : CodeOffset ,
129129 call_sites : impl Iterator < Item = FinalizedMachCallSite < ' a > > ,
130- ) -> anyhow :: Result < ( ) > {
130+ ) -> wasmtime_environ :: error :: Result < ( ) > {
131131 // Ensure that we see functions in offset order.
132132 assert ! ( start_offset >= self . last_start_offset) ;
133133 self . last_start_offset = start_offset;
@@ -252,36 +252,37 @@ pub struct ExceptionHandler {
252252impl < ' a > ExceptionTable < ' a > {
253253 /// Parse exception tables from a byte-slice as produced by
254254 /// [`ExceptionTableBuilder::serialize`].
255- pub fn parse ( data : & ' a [ u8 ] ) -> anyhow :: Result < ExceptionTable < ' a > > {
255+ pub fn parse ( data : & ' a [ u8 ] ) -> wasmtime_environ :: error :: Result < ExceptionTable < ' a > > {
256256 let mut data = Bytes ( data) ;
257- let callsite_count = data
258- . read :: < U32Bytes < LittleEndian > > ( )
259- . map_err ( |_| anyhow :: anyhow! ( "Unable to read callsite count prefix" ) ) ?;
257+ let callsite_count = data. read :: < U32Bytes < LittleEndian > > ( ) . map_err ( |_| {
258+ wasmtime_environ :: error :: anyhow! ( "Unable to read callsite count prefix" )
259+ } ) ?;
260260 let callsite_count = usize:: try_from ( callsite_count. get ( LittleEndian ) ) ?;
261261 let handler_count = data
262262 . read :: < U32Bytes < LittleEndian > > ( )
263- . map_err ( |_| anyhow :: anyhow!( "Unable to read handler count prefix" ) ) ?;
263+ . map_err ( |_| wasmtime_environ :: error :: anyhow!( "Unable to read handler count prefix" ) ) ?;
264264 let handler_count = usize:: try_from ( handler_count. get ( LittleEndian ) ) ?;
265265 let ( callsites, data) =
266266 object:: slice_from_bytes :: < U32Bytes < LittleEndian > > ( data. 0 , callsite_count)
267- . map_err ( |_| anyhow :: anyhow!( "Unable to read callsites slice" ) ) ?;
267+ . map_err ( |_| wasmtime_environ :: error :: anyhow!( "Unable to read callsites slice" ) ) ?;
268268 let ( frame_offsets, data) =
269- object:: slice_from_bytes :: < U32Bytes < LittleEndian > > ( data, callsite_count)
270- . map_err ( |_| anyhow:: anyhow!( "Unable to read frame_offsets slice" ) ) ?;
269+ object:: slice_from_bytes :: < U32Bytes < LittleEndian > > ( data, callsite_count) . map_err (
270+ |_| wasmtime_environ:: error:: anyhow!( "Unable to read frame_offsets slice" ) ,
271+ ) ?;
271272 let ( ranges, data) =
272273 object:: slice_from_bytes :: < U32Bytes < LittleEndian > > ( data, callsite_count)
273- . map_err ( |_| anyhow :: anyhow!( "Unable to read ranges slice" ) ) ?;
274+ . map_err ( |_| wasmtime_environ :: error :: anyhow!( "Unable to read ranges slice" ) ) ?;
274275 let ( tags, data) = object:: slice_from_bytes :: < U32Bytes < LittleEndian > > ( data, handler_count)
275- . map_err ( |_| anyhow :: anyhow!( "Unable to read tags slice" ) ) ?;
276+ . map_err ( |_| wasmtime_environ :: error :: anyhow!( "Unable to read tags slice" ) ) ?;
276277 let ( contexts, data) =
277278 object:: slice_from_bytes :: < U32Bytes < LittleEndian > > ( data, handler_count)
278- . map_err ( |_| anyhow :: anyhow!( "Unable to read contexts slice" ) ) ?;
279+ . map_err ( |_| wasmtime_environ :: error :: anyhow!( "Unable to read contexts slice" ) ) ?;
279280 let ( handlers, data) =
280281 object:: slice_from_bytes :: < U32Bytes < LittleEndian > > ( data, handler_count)
281- . map_err ( |_| anyhow :: anyhow!( "Unable to read handlers slice" ) ) ?;
282+ . map_err ( |_| wasmtime_environ :: error :: anyhow!( "Unable to read handlers slice" ) ) ?;
282283
283284 if !data. is_empty ( ) {
284- anyhow :: bail!( "Unexpected data at end of serialized exception table" ) ;
285+ wasmtime_environ :: error :: bail!( "Unexpected data at end of serialized exception table" ) ;
285286 }
286287
287288 Ok ( ExceptionTable {
0 commit comments