diff options
author | Steve Manuel <nilslice@gmail.com> | 2017-01-02 10:42:49 -0800 |
---|---|---|
committer | Steve Manuel <nilslice@gmail.com> | 2017-01-02 10:42:49 -0800 |
commit | 5c4286fbff820c65a38627270f29f967c47b599b (patch) | |
tree | 36a061494b6b232a0e3ef8c3c70ff35c07c9fe68 | |
parent | d61e0a214e394e66ad8cfdbdec6caddedd1d10f9 (diff) |
casting byte slice to string in error message
-rw-r--r-- | system/admin/handlers.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/system/admin/handlers.go b/system/admin/handlers.go index ff30040..1ff7156 100644 --- a/system/admin/handlers.go +++ b/system/admin/handlers.go @@ -909,7 +909,7 @@ func contentsHandler(res http.ResponseWriter, req *http.Request) { for i := range posts { err := json.Unmarshal(posts[i], &p) if err != nil { - log.Println("Error unmarshal json into", t, err, posts[i]) + log.Println("Error unmarshal json into", t, err, string(posts[i])) post := `<li class="col s12">Error decoding data. Possible file corruption.</li>` b.Write([]byte(post)) @@ -934,7 +934,7 @@ func contentsHandler(res http.ResponseWriter, req *http.Request) { for i := len(posts) - 1; i >= 0; i-- { err := json.Unmarshal(posts[i], &p) if err != nil { - log.Println("Error unmarshal json into", t, err, posts[i]) + log.Println("Error unmarshal json into", t, err, string(posts[i])) post := `<li class="col s12">Error decoding data. Possible file corruption.</li>` b.Write([]byte(post)) @@ -950,7 +950,7 @@ func contentsHandler(res http.ResponseWriter, req *http.Request) { for i := range posts { err := json.Unmarshal(posts[i], &p) if err != nil { - log.Println("Error unmarshal json into", t, err, posts[i]) + log.Println("Error unmarshal json into", t, err, string(posts[i])) post := `<li class="col s12">Error decoding data. Possible file corruption.</li>` b.Write([]byte(post)) |