Zondax / filecoin-solidity

Filecoin Solidity API Library
Apache License 2.0
94 stars 43 forks source link

Refinement on error handling #311

Closed snissn closed 1 year ago

snissn commented 1 year ago

refinement of https://github.com/Zondax/filecoin-solidity/issues/280#event-8604268786

for instances like this: https://github.com/Zondax/filecoin-solidity/blob/master/contracts/v0.8/AccountAPI.sol#L42

        bytes memory data = Actor.callNonSingletonByID(actorId, AccountTypes.AuthenticateMessageMethodNum, Misc.CBOR_CODEC, raw_request, 0, true);
        if (data.length != 0) {
            revert Actor.InvalidResponseLength(data);
        }

where it is expected we receive no data from the fvm and we do in fact receive data, raise an error, but don't expose data to the end user since this result is unexpected data and we do not anticipate meaningful errors here.

here also https://github.com/Zondax/filecoin-solidity/blob/master/contracts/v0.8/utils/Actor.sol#L164

:link: zboto Link