Skip to content

Commit

Permalink
just overload to not get it by mistake again ...
Browse files Browse the repository at this point in the history
  • Loading branch information
6543 committed Jan 23, 2021
1 parent 800c436 commit 8dc76bd
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions modules/context/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{}) {
Expand Down

0 comments on commit 8dc76bd

Please sign in to comment.