I am hitting a contract that follows an error emitting pattern like:
log(CustomError::ErrorOne)
revert(0)
where CustomError is defined as:
pub enum CustomError {
ErrorOne: (),
ErrorTwo: (),
…
}
In rust code, when calling a function (either by call() or simulate()) I sometimes see these reversions, as I would expect. In these cases, I am just given an Err() result with some log data. Is there a trivial way to detect and parse out my custom errors from this? Of course, I may not actually see my custom error and it may be an unrelated reversion/error, so ideally it’s easy to distinguish that too.