Skip to content
Snippets Groups Projects
Commit 8df91ac6 authored by Pea Nut's avatar Pea Nut Committed by jkito
Browse files

Catch Unmarshal error in getFromJSON

parent f0a2e2b1
No related branches found
No related tags found
1 merge request!186Improve error handling
......@@ -27,8 +27,8 @@ func ParseFile(f string) (Messages, error) {
func getFromJSON(b []byte) (Messages, error) {
var m Messages
json.Unmarshal(b, &m)
return m, nil
err := json.Unmarshal(b, &m)
return m, err
}
type Messages struct {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment