From 8cf6675ce459432c4713e41cea951d87b3627ee8 Mon Sep 17 00:00:00 2001 From: Mariano Cano Date: Mon, 19 Sep 2022 12:48:35 -0700 Subject: [PATCH] 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 --- acme/errors.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/acme/errors.go b/acme/errors.go index 95c006b7..3158b19b 100644 --- a/acme/errors.go +++ b/acme/errors.go @@ -337,7 +337,10 @@ func (e *Error) StatusCode() int { // Error allows AError to implement the error interface. 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.