From 182b4eea73881c611a0f519576aa6ad2aa6799c2 Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Sat, 27 Nov 2021 15:26:58 +0100 Subject: Update dependencies (#333) --- vendor/codeberg.org/gruf/go-errors/errors.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'vendor/codeberg.org/gruf/go-errors/errors.go') diff --git a/vendor/codeberg.org/gruf/go-errors/errors.go b/vendor/codeberg.org/gruf/go-errors/errors.go index 283bdb098..b1b41bf02 100644 --- a/vendor/codeberg.org/gruf/go-errors/errors.go +++ b/vendor/codeberg.org/gruf/go-errors/errors.go @@ -105,6 +105,25 @@ func Data(err error) ErrorData { return nil } +// UnwrapAll fully unwraps an error stack to produce a string output. +func UnwrapAll(err error) string { + if err == nil { + return "" + } + + // Start error output + out := err.Error() + err = Unwrap(err) + + // Unwrap and append each + for err != nil { + out += ": " + err.Error() + err = Unwrap(err) + } + + return out +} + // stringError is the simplest ErrorContext implementation type stringError string -- cgit v1.2.3