You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
The current wasm panic handler can be found here. It prints the panic message logging host function as error. While this works, it is not really nice. There are situations where it would be really nice to know the reason why something panicked as part of the returned error (without needing to grep stderr for it). For example in tests it would be much better to directly check the error message. Besides that it would also be nice for the relay chain, because currently it means that any failing parachain validation will print something to the output of the relay chain validator. This isn't that nice actually and also here it would be more be better to have more control over this.
So, my proposal is to add a new host function which only purpose is to handle such a panic case. I once created a pr for this with the proposed name PanicHandler, but @pepyakin didn't liked it. So, we should find a better name for this.
Besides that we will need to change the runtime-interface macros to support returning an error that will stop the execution and will return this error as error of the execution itself.
It would also be nice to be able to get the stack trace of the runtime and to attach this to the error (currently we already see the stack trace when a panic occurs and this can be quite helpful).