From 8738a105fc36588eb4035115c2f9eb979e0c1715 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Mon, 2 May 2022 11:23:06 +0200 Subject: [PATCH] internal: add HTTPError.Unwrap This allows callers to access the underlying error via errors.Unwrap. --- internal/internal.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/internal.go b/internal/internal.go index 065e66f..2790f3f 100644 --- a/internal/internal.go +++ b/internal/internal.go @@ -100,6 +100,10 @@ func (err *HTTPError) Error() string { } } +func (err *HTTPError) Unwrap() error { + return err.Err +} + // DAVError is a XML error with HTTP status and a human readable message type DAVError struct { Code int