brson / wasm-opt-rs

Rust bindings for Binaryen's wasm-opt
Apache License 2.0
64 stars 10 forks source link

Teach cxx to catch (Map)ParseException #102

Closed dtolnay closed 2 years ago

dtolnay commented 2 years ago

This implements the last suggestion in https://github.com/brson/wasm-opt-rs/issues/95#issue-1408530390.

Avoids needing to wrap every function that might throw wasm::ParseException in its own individual try { ... } catch (const wasm::ParseException &e) { throw parse_exception_to_runtime_error(e); }.

I included an update to cxx 1.0.79 to pull in https://github.com/dtolnay/cxx/pull/1114 for a slight convenience.

brson commented 2 years ago

Neat. Thanks again. I'll have to update my blog post to talk about this now!