Use eris for error management

This commit is contained in:
Jamie Curnow
2023-02-24 17:19:07 +10:00
parent 80315bd50e
commit c288886fd4
44 changed files with 173 additions and 128 deletions

View File

@ -1,7 +1,6 @@
package certificateauthority
import (
goerrors "errors"
"fmt"
"os"
"path/filepath"
@ -10,6 +9,8 @@ import (
"npm/internal/database"
"npm/internal/errors"
"npm/internal/types"
"github.com/rotisserie/eris"
)
const (
@ -79,7 +80,7 @@ func (m *Model) Check() error {
var err error
if m.CABundle != "" {
if _, fileerr := os.Stat(filepath.Clean(m.CABundle)); goerrors.Is(fileerr, os.ErrNotExist) {
if _, fileerr := os.Stat(filepath.Clean(m.CABundle)); eris.Is(fileerr, os.ErrNotExist) {
err = errors.ErrCABundleDoesNotExist
}
}