From a5f19c3c9624ed8dfc409873fe8e5d44baed1992 Mon Sep 17 00:00:00 2001 From: Darren Cunningham Date: Mon, 11 Nov 2024 15:53:46 -0500 Subject: [PATCH 1/2] handle 410 --- error.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/error.go b/error.go index 98eb96d..10f1d63 100644 --- a/error.go +++ b/error.go @@ -157,6 +157,8 @@ func getErrFauna(httpStatus int, res *queryResponse, attempts int) error { return &ErrAuthentication{res.Error} case http.StatusForbidden: return &ErrAuthorization{res.Error} + case http.StatusGone: + return &ErrAuthorization{res.Error} case http.StatusTooManyRequests: return &ErrThrottling{res.Error} case httpStatusQueryTimeout: From fce7259eb50ff5965713a3f09b2050a86df6c8cc Mon Sep 17 00:00:00 2001 From: Darren Cunningham Date: Mon, 11 Nov 2024 16:00:08 -0500 Subject: [PATCH 2/2] include test --- error_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/error_test.go b/error_test.go index 8911ff0..1d5a475 100644 --- a/error_test.go +++ b/error_test.go @@ -82,6 +82,15 @@ func TestGetErrFauna(t *testing.T) { }, wantErr: true, }, + { + name: "Feature not enabled", + args: args{ + httpStatus: http.StatusGone, + serviceError: &ErrFauna{Code: "", Message: ""}, + errType: &ErrAuthorization{}, + }, + wantErr: true, + }, { name: "Too many requests", args: args{