From cdfe68038a1d14c9cdaa2d8167ca6abd0d5d5864 Mon Sep 17 00:00:00 2001 From: aeneasr <3372410+aeneasr@users.noreply.github.com> Date: Mon, 25 Nov 2024 10:43:12 +0100 Subject: [PATCH] chore: make serialization error wrappable See https://github.com/ory-corp/cloud/issues/7311 --- errors.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/errors.go b/errors.go index 09ac1d65..332dbec2 100644 --- a/errors.go +++ b/errors.go @@ -25,8 +25,12 @@ var ( ErrInvalidatedAuthorizeCode = stderr.New("Authorization code has ben invalidated") // ErrSerializationFailure is an error indicating that the transactional capable storage could not guarantee // consistency of Update & Delete operations on the same rows between multiple sessions. - ErrSerializationFailure = stderr.New("The request could not be completed due to concurrent access") - ErrUnknownRequest = &RFC6749Error{ + ErrSerializationFailure = &RFC6749Error{ + ErrorField: errUnknownErrorName, + DescriptionField: "The request could not be completed because another request is competing for the same resource.", + CodeField: http.StatusConflict, + } + ErrUnknownRequest = &RFC6749Error{ ErrorField: errUnknownErrorName, DescriptionField: "The handler is not responsible for this request.", CodeField: http.StatusBadRequest,