Refactor domain error to use errorId (#790)
* Refactor domain error to use errorId * Wrap accepts options and uses New internally
This commit is contained in:
1 parent
b8a5b9adf1
commit
d30dd0ff64
8 files changed
+184
-103
No files matched your search
@@ -16,7 +16,6 @@ type Option func(*Options)
|
||||
type Options struct {
|
||||
withErrWrapped error
|
||||
withErrMsg string
|
||||
withOp Op
|
||||
}
|
||||
|
||||
func getDefaultOptions() Options {
|
||||
@@ -38,11 +37,3 @@ func WithMsg(msg string) Option {
|
||||
o.withErrMsg = msg
|
||||
}
|
||||
}
|
||||
|
||||
// WithOp provides an option to provide the operation that's raising/propagating
|
||||
// the error.
|
||||
func WithOp(op Op) Option {
|
||||
return func(o *Options) {
|
||||
o.withOp = op
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user