mirror of
https://github.com/pldubouilh/gossa.git
synced 2024-04-21 12:31:39 +00:00
Merge pull request #33 from jeslinmx/httpstatus
Respond with http status 500 upon error
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
name: Go
|
||||
on: [push]
|
||||
on: [push, pull_request]
|
||||
jobs:
|
||||
|
||||
build:
|
||||
|
||||
@@ -57,6 +57,7 @@ func check(e error) {
|
||||
func exitPath(w http.ResponseWriter, s ...interface{}) {
|
||||
if r := recover(); r != nil {
|
||||
log.Println("error", s, r)
|
||||
w.WriteHeader(500)
|
||||
w.Write([]byte("error"))
|
||||
} else if *verb {
|
||||
log.Println(s...)
|
||||
|
||||
Reference in New Issue
Block a user