From 66e55a728c76d7b2a912aeda1c2d505ca89d41ec Mon Sep 17 00:00:00 2001 From: Heitor Danilo Date: Mon, 6 Jan 2025 12:56:27 -0300 Subject: [PATCH] feat(api): error code not implemented --- api/pkg/echo/handlers/pkg/converter/converter.go | 2 ++ api/services/errors.go | 2 ++ 2 files changed, 4 insertions(+) diff --git a/api/pkg/echo/handlers/pkg/converter/converter.go b/api/pkg/echo/handlers/pkg/converter/converter.go index 1d373dd3a0c..bf84de814dc 100644 --- a/api/pkg/echo/handlers/pkg/converter/converter.go +++ b/api/pkg/echo/handlers/pkg/converter/converter.go @@ -28,6 +28,8 @@ func FromErrServiceToHTTPStatus(code int) int { return http.StatusForbidden case services.ErrCodeNoContentChange: return http.StatusNoContent + case services.ErrCodeNotImplemented: + return http.StatusNotImplemented default: return http.StatusInternalServerError } diff --git a/api/services/errors.go b/api/services/errors.go index 6236fcee825..969d26af979 100644 --- a/api/services/errors.go +++ b/api/services/errors.go @@ -34,6 +34,8 @@ const ( ErrCodeNoContentChange // ErrCodeCreated is the error code to be used when the resource was created, but the following operations failed. ErrCodeCreated + // ErrCodeNotImplemented is the error code to be used when the resource is not yet implemented. + ErrCodeNotImplemented ) // ErrDataNotFound structure should be used to add errors.Data to an error when the resource is not found.