We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 800c436 commit 8dc76bdCopy full SHA for 8dc76bd
modules/context/api.go
@@ -73,6 +73,11 @@ type APIRedirect struct{}
73
// swagger:response string
74
type APIString string
75
76
+// ServerError responds with error message, status is 500
77
+func (ctx *APIContext) ServerError(title string, err error) {
78
+ ctx.Error(http.StatusInternalServerError, title, err)
79
+}
80
+
81
// Error responds with an error message to client with given obj as the message.
82
// If status is 500, also it prints error to log.
83
func (ctx *APIContext) Error(status int, title string, obj interface{}) {
0 commit comments