diff options
| author | Horus3 | 2015-03-30 19:25:13 +0200 |
|---|---|---|
| committer | Horus3 | 2015-03-30 19:25:13 +0200 |
| commit | 49255cff30fb2f588217aefb0fe547ef0fd213fc (patch) | |
| tree | b143d9a07582a2f2b14652a30d9011856b68ecb4 | |
| parent | a6c354692f35fefb4c6821ca15c05ad48a64fc8f (diff) | |
| download | web2irc-49255cff30fb2f588217aefb0fe547ef0fd213fc.tar.gz | |
Fix small bug in error handling.
| -rw-r--r-- | handler.go | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -28,11 +28,14 @@ func WebhookHandler(w http.ResponseWriter, r *http.Request) { err := decoder.Decode(&hook) if err != nil { + var body string content, cError := ioutil.ReadAll(r.Body) if err != nil { log.Println("Can't read r.Body.", cError) + body = "Message not readable." + } else { + body = string(content) } - body := string(content) log.Print("Wrong JSON.", err, "Original message: "+body) |
