feat(errorsx): introduce NewTopLevelGenericErrWrapper (#511)
Part of https://github.com/ooni/probe/issues/1733 and diff has been extracted from https://github.com/ooni/probe-cli/pull/506.
This commit is contained in:
parent
d7b9c8f0a8
commit
201f602a40
2 changed files with 22 additions and 0 deletions
|
|
@ -92,3 +92,9 @@ func NewErrWrapper(c Classifier, op string, err error) *ErrWrapper {
|
|||
WrappedErr: err,
|
||||
}
|
||||
}
|
||||
|
||||
// NewTopLevelGenericErrWrapper wraps an error occurring at top
|
||||
// level using the most generic available classifier.
|
||||
func NewTopLevelGenericErrWrapper(err error) *ErrWrapper {
|
||||
return NewErrWrapper(ClassifyGenericError, TopLevelOperation, err)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue