-
Notifications
You must be signed in to change notification settings - Fork 43
./utils/Actor.sol error handling #280
Comments
@snissn when success is |
@snissn what do you think about using custom error types here? https://blog.soliditylang.org/2021/04/21/custom-errors/
|
I personally feel uneasy about dumping unwrapped bytes on require. |
@emmanuelm41 @raulk defintely defer to you and others on the content of the error messages and how to handle them. Big picture my thinking is if there's an error on the fvm side, it would be nice as a user of the solidity filecoin library to see that error if they're relevant and actionable AND there seemed to be a place in the filecoin library that was swallowing the error that could potentially throw/escalate it in when it reverts |
@snissn the question here is what actors return when the call is not successful. I see we can propagate them, but I am not sure what actors actually return today |
From a conversation with @Stebalien there is not really an error code that the FVM propogats to the EVM that is worth exposing to the user. That said we can add custom errors to our contract to improve usability of the api This is a new-ish solidity feature! (April 2021) |
Error handling is done via
require(success == true, CALL_ERROR_MESSAGE);
where CALL_ERROR_MESSAGE is a constant. This swallows any potential error messages that were propogated from the delegated contract call. I suggest changing the require check to something likerequire(success == true, data);
to ensure the error message gets bubbled up properly.Note may be preferable to change success == true to just checking the bool success
🔗 zboto Link
The text was updated successfully, but these errors were encountered: