diff --git a/handlers/newObjects.go b/handlers/newObjects.go index 00fbab5..2800067 100644 --- a/handlers/newObjects.go +++ b/handlers/newObjects.go @@ -227,7 +227,7 @@ func (a *RestAPI) NewGetByAttribute(ctx echo.Context, containerID apiserver.Cont res, err := a.search(ctx.Request().Context(), btoken, cnrID, attrKey, attrVal, object.MatchStringEqual) if err != nil { resp := a.logAndGetErrorResponse("could not search for objects", err) - return ctx.JSON(http.StatusNotFound, resp) + return ctx.JSON(http.StatusInternalServerError, resp) } defer func() { @@ -247,7 +247,7 @@ func (a *RestAPI) NewGetByAttribute(ctx echo.Context, containerID apiserver.Cont } resp := a.logAndGetErrorResponse("read object list failed", err) - return ctx.JSON(http.StatusNotFound, resp) + return ctx.JSON(http.StatusInternalServerError, resp) } var addrObj oid.Address @@ -287,7 +287,7 @@ func (a *RestAPI) NewHeadByAttribute(ctx echo.Context, containerID apiserver.Con res, err := a.search(ctx.Request().Context(), btoken, cnrID, attrKey, attrVal, object.MatchStringEqual) if err != nil { resp := a.logAndGetErrorResponse("could not search for objects", err) - return ctx.JSON(http.StatusNotFound, resp) + return ctx.JSON(http.StatusInternalServerError, resp) } defer func() { @@ -307,7 +307,7 @@ func (a *RestAPI) NewHeadByAttribute(ctx echo.Context, containerID apiserver.Con } resp := a.logAndGetErrorResponse("read object list failed", err) - return ctx.JSON(http.StatusNotFound, resp) + return ctx.JSON(http.StatusInternalServerError, resp) } var addrObj oid.Address diff --git a/handlers/objects.go b/handlers/objects.go index 2005aa8..3b9ae02 100644 --- a/handlers/objects.go +++ b/handlers/objects.go @@ -1044,7 +1044,7 @@ func (a *RestAPI) GetByAttribute(ctx echo.Context, containerID apiserver.Contain res, err := a.search(ctx.Request().Context(), btoken, cnrID, attrKey, attrVal, object.MatchStringEqual) if err != nil { resp := a.logAndGetErrorResponse("could not search for objects", err) - return ctx.JSON(http.StatusNotFound, resp) + return ctx.JSON(http.StatusInternalServerError, resp) } defer func() { @@ -1064,7 +1064,7 @@ func (a *RestAPI) GetByAttribute(ctx echo.Context, containerID apiserver.Contain } resp := a.logAndGetErrorResponse("read object list failed", err) - return ctx.JSON(http.StatusNotFound, resp) + return ctx.JSON(http.StatusInternalServerError, resp) } var addrObj oid.Address @@ -1099,7 +1099,7 @@ func (a *RestAPI) HeadByAttribute(ctx echo.Context, containerID apiserver.Contai res, err := a.search(ctx.Request().Context(), btoken, cnrID, attrKey, attrVal, object.MatchStringEqual) if err != nil { resp := a.logAndGetErrorResponse("could not search for objects", err) - return ctx.JSON(http.StatusNotFound, resp) + return ctx.JSON(http.StatusInternalServerError, resp) } defer func() { @@ -1119,7 +1119,7 @@ func (a *RestAPI) HeadByAttribute(ctx echo.Context, containerID apiserver.Contai } resp := a.logAndGetErrorResponse("read object list failed", err) - return ctx.JSON(http.StatusNotFound, resp) + return ctx.JSON(http.StatusInternalServerError, resp) } var addrObj oid.Address