Sfoglia il codice sorgente

Return the internal error instead of the ACME error

For ACME errors, return the internal error string instead of the
ACME one on the "Error() string" function. This way the logs will
have more information about the cause of an error.

Fixes #1057
Mariano Cano 4 anni fa
parent
commit
8cf6675ce4
1 ha cambiato i file con 4 aggiunte e 1 eliminazioni
  1. 4 1
      acme/errors.go

+ 4 - 1
acme/errors.go

@@ -337,7 +337,10 @@ func (e *Error) StatusCode() int {
 
 
 // Error allows AError to implement the error interface.
 // Error allows AError to implement the error interface.
 func (e *Error) Error() string {
 func (e *Error) Error() string {
-	return e.Detail
+	if e.Err == nil {
+		return e.Detail
+	}
+	return e.Err.Error()
 }
 }
 
 
 // Cause returns the internal error and implements the Causer interface.
 // Cause returns the internal error and implements the Causer interface.