more informative error

This commit is contained in:
programmer10110 2020-07-29 22:32:17 +03:00
parent 42b085728f
commit bd0e4b59ce
1 changed files with 1 additions and 1 deletions

View File

@ -106,7 +106,7 @@ func (fs *FileStorage) GetMessages(offset int) ([]Message, error) {
}
if err = json.Unmarshal(row, &data); err != nil {
return nil, err
return nil, fmt.Errorf("failed to unmarshal a message %s: %v", string(row), err)
}
msgs = append(msgs, data)
}