Return json on 500 error from API (#11574)
Return json on 500 error from API (#11574)

* add API specific InternalServerError()

Co-authored-by: zeripath <6a547fdd28db89120bdd70d4af1f9ba672ccd43a@cantab.net>

* return 500 error msg only if not Production mode

* Revert "return 500 error msg only if not Production mode"

This reverts commit 8467b2cee674ad205b452780ca88abb1b27643c8.

* InternalServerError

Co-authored-by: zeripath <6a547fdd28db89120bdd70d4af1f9ba672ccd43a@cantab.net>
sapk-fork/gitea,vCaesar/gitea,vCaesar/gitea,vdbt/gitea,go-gitea/gitea,sapk-fork/gitea,lafriks/gitea,sapk-fork/gitea,cez81/gitea,cez81/gitea,go-gitea/gitea,lafriks/gitea,go-gitea/gitea,sapk-fork/gitea,lafriks/gitea,cez81/gitea,vdbt/gitea