proxy-wasm / proxy-wasm-rust-sdk

WebAssembly for Proxies (Rust SDK)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

panics in many hostcalls - could I add error handling to these?

cetanu opened this issue · comments

Example that I am running into:
https://github.com/proxy-wasm/proxy-wasm-rust-sdk/blob/master/src/hostcalls.rs#L248

This makes it quite challenging to handle problems without overriding/re-implementing everything myself

Could these return a Status instead of panicking?
For example, perhaps an InternalFailure: https://github.com/proxy-wasm/proxy-wasm-rust-sdk/blob/master/src/types.rs#L50

If this is desired then I can write up a PR for it.

Could you please explain what problems are you trying to handle? panic is used intentionally in places that are breaking the ABI spec, and those are mostly unrecoverable errors.

Hmmm okay... I must have been doing something quite wrong then. I think I was not properly setting up the root context and this was causing panics. I guess we can just close this.