From eb170003b81504ba6eb85f950c223dc9eaf1cfca Mon Sep 17 00:00:00 2001 From: kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com> Date: Thu, 30 Nov 2023 16:22:34 +0000 Subject: [bugfix] return 400 Bad Request on more cases of malformed AS data (#2399) --- internal/gtserror/withcode.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'internal/gtserror/withcode.go') diff --git a/internal/gtserror/withcode.go b/internal/gtserror/withcode.go index d17a4e42e..da489225c 100644 --- a/internal/gtserror/withcode.go +++ b/internal/gtserror/withcode.go @@ -39,13 +39,16 @@ type WithCode interface { // Unwrap returns the original error. // This should *NEVER* be returned to a client as it may contain sensitive information. Unwrap() error + // Error serializes the original internal error for debugging within the GoToSocial logs. // This should *NEVER* be returned to a client as it may contain sensitive information. Error() string + // Safe returns the API-safe version of the error for serialization towards a client. // There's not much point logging this internally because it won't contain much helpful information. Safe() string - // Code returns the status code for serving to a client. + + // Code returns the status code for serving to a client. Code() int } -- cgit v1.2.3