aboutsummaryrefslogtreecommitdiff
path: root/internal/context
diff options
context:
space:
mode:
authorMateusz Reszka <mateusz.reszka@outlook.com>2022-10-22 17:52:48 +0200
committerGitHub <noreply@github.com>2022-10-22 23:52:48 +0800
commit742bc36edd92229cf78608af7f950e65f71a0a01 (patch)
tree56235af3f9492d4f33b8fa79fbd51da96fde7257 /internal/context
parenta7299bbb8d8b363f3d828e04e060921aa0c31d93 (diff)
api: support put content (#7114)
Co-authored-by: Joe Chen <jc@unknwon.io>
Diffstat (limited to 'internal/context')
-rw-r--r--internal/context/api.go8
1 files changed, 6 insertions, 2 deletions
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.