// ErrorToFailure implements FailureConverter.
// nolint:revive // Keeping all of the logic together for readability, even if it means the function is long.
func (e knownErrorFailureConverter) ErrorToFailure(err error) (nexus.Failure, error) {
failure_converter.go
if err == nil {
return nexus.Failure{}, nil
}
// NOTE: not using errors.Unwrap here we are intentionally only supporting unwrapping known errors.
case *nexus.FailureError:
f := typedErr.Failure