Maintenance: improve error wrapping

This commit is contained in:
Quentin McGaw (desktop)
2021-05-30 16:14:08 +00:00
parent be22c8547f
commit 876563c492
19 changed files with 96 additions and 41 deletions

View File

@@ -1,7 +1,6 @@
package configuration
import (
"fmt"
"testing"
"github.com/stretchr/testify/assert"
@@ -71,11 +70,11 @@ zZjrL52saevO25cigVl+hxcnY8DTpbk=
err error
}{
"no input": {
err: fmt.Errorf("cannot decode PEM block from client key"),
err: errDecodePEMBlockClientKey,
},
"bad input": {
b: []byte{1, 2, 3},
err: fmt.Errorf("cannot decode PEM block from client key"),
err: errDecodePEMBlockClientKey,
},
"valid key": {
b: []byte(validPEM),
@@ -147,11 +146,11 @@ iOCYTbretAFZRhh6ycUN5hBeN8GMQxiMreMtDV4PEIQ=
err error
}{
"no input": {
err: fmt.Errorf("cannot decode PEM block from client certificate"),
err: errDecodePEMBlockClientCert,
},
"bad input": {
b: []byte{1, 2, 3},
err: fmt.Errorf("cannot decode PEM block from client certificate"),
err: errDecodePEMBlockClientCert,
},
"valid key": {
b: []byte(validPEM),