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:
Louis Ruch authored and GitHub committed 2020-12-09 10:11:38 -08:00
1 parent aa4157639c
commit ec0020de90
33 files changed
+996 -374

No files matched your search

+1 -3
View File
@@ -1,8 +1,6 @@
package static
import (
"fmt"
"github.com/hashicorp/boundary/internal/errors"
"github.com/hashicorp/boundary/internal/host/static/store"
"github.com/hashicorp/boundary/internal/oplog"
@@ -21,7 +19,7 @@ type HostCatalog struct {
// ignored.
func NewHostCatalog(scopeId string, opt ...Option) (*HostCatalog, error) {
if scopeId == "" {
return nil, fmt.Errorf("new: static host catalog: no scope id: %w", errors.ErrInvalidParameter)
return nil, errors.New(errors.InvalidParameter, "static.NewHostCatalog", "no scope id")
}
opts := getOpts(opt...)