Refactor host_repo -> domain errors (#786)
* Refactor domain errors: New -> E, create helper New and Wrap * Update host repo to use domain errors
This commit is contained in:
1 parent
aa4157639c
commit
ec0020de90
33 files changed
+996
-374
No files matched your search
@@ -14,6 +14,7 @@ type Option func(*Options)
|
||||
|
||||
// Options - how Options are represented.
|
||||
type Options struct {
|
||||
withCode Code
|
||||
withErrWrapped error
|
||||
withErrMsg string
|
||||
withOp Op
|
||||
@@ -46,3 +47,11 @@ func WithOp(op Op) Option {
|
||||
o.withOp = op
|
||||
}
|
||||
}
|
||||
|
||||
// WithCode provides an option to provide a code when creating a new
|
||||
// error.
|
||||
func WithCode(code Code) Option {
|
||||
return func(o *Options) {
|
||||
o.withCode = code
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user