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
@@ -89,3 +89,20 @@ func IsMissingTableError(err error) bool {
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// IsNotFoundError returns a boolean indicating whether the error is known to
|
||||
// report a not found violation.
|
||||
func IsNotFoundError(err error) bool {
|
||||
if err == nil {
|
||||
return false
|
||||
}
|
||||
|
||||
var domainErr *Err
|
||||
if errors.As(err, &domainErr) {
|
||||
if domainErr.Code == RecordNotFound {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
Reference in new issue
Block a user