From edcee14d07bae129e2d1a06d99c30fc6f659ff5e Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Fri, 11 Nov 2022 12:18:38 +0100 Subject: [feature] Read + Write tombstones for deleted Actors (#1005) * [feature] Read + Write tombstones for deleted Actors * copyTombstone * update to use resultcache instead of old ttl cache Signed-off-by: kim * update go-cache library to fix result cache capacity / ordering bugs Signed-off-by: kim * bump go-cache/v3 to v3.1.6 to fix bugs Signed-off-by: kim * switch on status code * better explain ErrGone reasoning Signed-off-by: kim Co-authored-by: kim --- internal/gtserror/withcode.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'internal/gtserror/withcode.go') diff --git a/internal/gtserror/withcode.go b/internal/gtserror/withcode.go index 6672000dc..ddf9371ac 100644 --- a/internal/gtserror/withcode.go +++ b/internal/gtserror/withcode.go @@ -161,3 +161,16 @@ func NewErrorUnprocessableEntity(original error, helpText ...string) WithCode { code: http.StatusUnprocessableEntity, } } + +// NewErrorGone returns an ErrorWithCode 410 with the given original error and optional help text. +func NewErrorGone(original error, helpText ...string) WithCode { + safe := http.StatusText(http.StatusGone) + if helpText != nil { + safe = safe + ": " + strings.Join(helpText, ": ") + } + return withCode{ + original: original, + safe: errors.New(safe), + code: http.StatusGone, + } +} -- cgit v1.2.3