feat: log more information on authentication errors
Some checks failed
Cadoles/go-http-peering/pipeline/head There was a failure building this commit
Some checks failed
Cadoles/go-http-peering/pipeline/head There was a failure building this commit
This commit is contained in:
@ -5,11 +5,11 @@ import (
|
||||
"crypto/rsa"
|
||||
"crypto/sha256"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
jwt "github.com/dgrijalva/jwt-go"
|
||||
"github.com/pkg/errors"
|
||||
|
||||
peering "forge.cadoles.com/Cadoles/go-http-peering"
|
||||
"forge.cadoles.com/Cadoles/go-http-peering/crypto"
|
||||
@ -52,7 +52,7 @@ func (c *Client) Advertise(attrs peering.PeerAttributes) error {
|
||||
case http.StatusConflict:
|
||||
return peering.ErrPeerExists
|
||||
default:
|
||||
return ErrUnexpectedResponse
|
||||
return errors.Wrapf(ErrUnexpectedResponse, "unexpected http status code '%d'", res.StatusCode)
|
||||
}
|
||||
}
|
||||
|
||||
@ -76,7 +76,7 @@ func (c *Client) UpdateAttributes(attrs peering.PeerAttributes) error {
|
||||
case http.StatusForbidden:
|
||||
return ErrRejected
|
||||
default:
|
||||
return ErrUnexpectedResponse
|
||||
return errors.Wrapf(ErrUnexpectedResponse, "unexpected http status code '%d'", res.StatusCode)
|
||||
}
|
||||
}
|
||||
|
||||
@ -96,7 +96,7 @@ func (c *Client) Ping() error {
|
||||
case http.StatusForbidden:
|
||||
return ErrRejected
|
||||
default:
|
||||
return ErrUnexpectedResponse
|
||||
return errors.Wrapf(ErrUnexpectedResponse, "unexpected http status code '%d'", res.StatusCode)
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user