From 742bc36edd92229cf78608af7f950e65f71a0a01 Mon Sep 17 00:00:00 2001 From: Mateusz Reszka Date: Sat, 22 Oct 2022 17:52:48 +0200 Subject: api: support put content (#7114) Co-authored-by: Joe Chen --- internal/context/api.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'internal/context') diff --git a/internal/context/api.go b/internal/context/api.go index 938e207f..b3922bb6 100644 --- a/internal/context/api.go +++ b/internal/context/api.go @@ -9,6 +9,7 @@ import ( "net/http" "strings" + "github.com/pkg/errors" "github.com/unknwon/paginater" "gopkg.in/macaron.v1" log "unknwon.dev/clog/v2" @@ -49,8 +50,11 @@ func (c *APIContext) ErrorStatus(status int, err error) { // Error renders the 500 response. func (c *APIContext) Error(err error, msg string) { - log.ErrorDepth(5, "%s: %v", msg, err) - c.ErrorStatus(http.StatusInternalServerError, err) + log.ErrorDepth(4, "%s: %v", msg, err) + c.ErrorStatus( + http.StatusInternalServerError, + errors.New("Something went wrong, please check the server logs for more information."), + ) } // Errorf renders the 500 response with formatted message. -- cgit v1.2.3