solang icon indicating copy to clipboard operation
solang copied to clipboard

Support `require()` messages in Substrate debug output

Open xermicus opened this issue 3 years ago • 2 comments

Call seal_debug_message in assert_failure, to get messages from require() into the debug message buffer.

xermicus avatar Jul 13 '22 08:07 xermicus

This information is in the return value on Ethereum. This makes it possible to use try c.foo() catch Error(reason) { .. } and programmatically use the revert() or require() reason string, see https://docs.soliditylang.org/en/v0.8.15/control-structures.html#try-catch

Having said that, I am not sure that it is possible to catch failing functions on substrate.

seanyoung avatar Jul 13 '22 09:07 seanyoung

I see, this might be a bit more involved then.

xermicus avatar Jul 13 '22 12:07 xermicus

This is solved since a while ago. Additionally, after #1454 it will be fully usable in try catch.

xermicus avatar Aug 17 '23 10:08 xermicus