refactor(errorsx): directly return ErrWrapper when needed
The utility of SafeErrWrapperBuilder is low. Let us instead change the code to always create ErrWrapper when we're in this package. While there, also note some TODO-next items. Part of https://github.com/ooni/probe/issues/1505.
This commit is contained in:
parent
362ece04c4
commit
b9ff9136e2
3 changed files with 188 additions and 69 deletions
|
|
@ -105,6 +105,8 @@ func toFailureString(err error) string {
|
|||
// The list returned here matches the values used by MK unless
|
||||
// explicitly noted otherwise with a comment.
|
||||
|
||||
// TODO(bassosimone): we need to always apply this rule not only here
|
||||
// when we're making the most generic conversion.
|
||||
var errwrapper *ErrWrapper
|
||||
if errors.As(err, &errwrapper) {
|
||||
return errwrapper.Error() // we've already wrapped it
|
||||
|
|
|
|||
Loading…
Reference in a new issue