mirror of
https://github.com/pldubouilh/gossa.git
synced 2026-10-26 23:09:56 -04:00
respond with http status 500 upon error
This commit is contained in:
1 parent
e2dc84f829
commit
eb9ba8c099
1 file changed
+1
@@ -57,6 +57,7 @@ func check(e error) {
|
|||||||
func exitPath(w http.ResponseWriter, s ...interface{}) {
|
func exitPath(w http.ResponseWriter, s ...interface{}) {
|
||||||
if r := recover(); r != nil {
|
if r := recover(); r != nil {
|
||||||
log.Println("error", s, r)
|
log.Println("error", s, r)
|
||||||
|
w.WriteHeader(500)
|
||||||
w.Write([]byte("error"))
|
w.Write([]byte("error"))
|
||||||
} else if *verb {
|
} else if *verb {
|
||||||
log.Println(s...)
|
log.Println(s...)
|
||||||
|
|||||||
Reference in new issue
Block a user