]> source.dussan.org Git - gitea.git/commitdiff
just overload to not get it by mistake again ... (#14440)
author6543 <6543@obermui.de>
Sat, 23 Jan 2021 19:33:43 +0000 (20:33 +0100)
committerGitHub <noreply@github.com>
Sat, 23 Jan 2021 19:33:43 +0000 (21:33 +0200)
modules/context/api.go

index aa4b6b9e89239ffc7fd2bb9fe41e46ebc5ecc68b..7771ec1b147623f572089245bd7d368086dccf33 100644 (file)
@@ -73,6 +73,11 @@ type APIRedirect struct{}
 // swagger:response string
 type APIString string
 
+// ServerError responds with error message, status is 500
+func (ctx *APIContext) ServerError(title string, err error) {
+       ctx.Error(http.StatusInternalServerError, title, err)
+}
+
 // Error responds with an error message to client with given obj as the message.
 // If status is 500, also it prints error to log.
 func (ctx *APIContext) Error(status int, title string, obj interface{}) {