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

@ -4,9 +4,10 @@ import (
"crypto/rsa"
"crypto/x509"
"encoding/pem"
"errors"
"npm/internal/config"
"github.com/rotisserie/eris"
)
var (
@ -21,7 +22,7 @@ func GetPrivateKey() (*rsa.PrivateKey, error) {
var blankKey *rsa.PrivateKey
if config.PrivateKey == "" {
return blankKey, errors.New("Could not get Private Key from configuration")
return blankKey, eris.New("Could not get Private Key from configuration")
}
var err error
@ -48,7 +49,7 @@ func GetPublicKey() (*rsa.PublicKey, error) {
var blankKey *rsa.PublicKey
if config.PublicKey == "" {
return blankKey, errors.New("Could not get Public Key filename, check environment variables")
return blankKey, eris.New("Could not get Public Key filename, check environment variables")
}
var err error