aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--client.go15
-rw-r--r--errors.go4
-rw-r--r--messages.go4
3 files changed, 8 insertions, 15 deletions
diff --git a/client.go b/client.go
index c67c1c8..12812dd 100644
--- a/client.go
+++ b/client.go
@@ -159,11 +159,7 @@ func (c *Client) Register(a *Account) (*Registration, error) {
Contact: a.Contact,
}
c.Location = c.Dir.NewReg
- err := c.post(a, r)
- if err, ok := err.(Problem); ok {
- log.Println("REGISTER", err.Err, err)
- }
- return r, err
+ return r, c.post(a, r)
}
// Agree to TOS
@@ -173,14 +169,12 @@ func (c *Client) Agree(a *Account) (*Registration, error) {
Contact: a.Contact,
Agreement: c.Link["terms-of-service"],
}
- err := c.post(a, r)
- return r, err
+ return r, c.post(a, r)
}
func (c *Client) Query(a *Account) (*Registration, error) {
r := &Registration{Resource: ResRegister}
- err := c.post(a, r)
- return r, err
+ return r, c.post(a, r)
}
func (c *Client) Authorize(a *Account, domain string) (*Authorization, error) {
@@ -192,8 +186,7 @@ func (c *Client) Authorize(a *Account, domain string) (*Authorization, error) {
},
}
c.Location = c.Dir.NewAuthz
- err := c.post(a, r)
- return r, err
+ return r, c.post(a, r)
}
func (c Client) String() string {
diff --git a/errors.go b/errors.go
index 10053b7..60eb636 100644
--- a/errors.go
+++ b/errors.go
@@ -26,7 +26,3 @@ var urnErrors = map[string]error{
"urn:acme:error:unauthorized": ErrUnauthorized,
"urn:acme:error:unknownHost": ErrUnknownHost,
}
-
-func (p Problem) Error() string {
- return p.Detail
-}
diff --git a/messages.go b/messages.go
index 6a2846b..7546088 100644
--- a/messages.go
+++ b/messages.go
@@ -72,6 +72,10 @@ type Problem struct {
Err error `json:"-"`
}
+func (p Problem) Error() string {
+ return p.Detail
+}
+
// Status of request
type Status int