mirror of
https://github.com/pldubouilh/gossa
synced 2025-12-06 16:32:52 +01:00
Merge pull request #33 from jeslinmx/httpstatus
Respond with http status 500 upon error
This commit is contained in:
commit
b5965c2199
2 changed files with 2 additions and 1 deletions
2
.github/workflows/go.yml
vendored
2
.github/workflows/go.yml
vendored
|
|
@ -1,5 +1,5 @@
|
||||||
name: Go
|
name: Go
|
||||||
on: [push]
|
on: [push, pull_request]
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
build:
|
build:
|
||||||
|
|
|
||||||
|
|
@ -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...)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue