Skip to content

Commit

Permalink
Fix exception message in BytesToStr to be clearer
Browse files Browse the repository at this point in the history
Suggested and tested by @generalmimon
  • Loading branch information
GreyCat committed Mar 29, 2024
1 parent 296c155 commit e822da7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kaitai/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func BytesToStr(in []byte, decoder *encoding.Decoder) (string, error) {
o := transform.NewReader(i, decoder)
d, err := ioutil.ReadAll(o)
if err != nil {
return "", fmt.Errorf("BytesToStr: error reading all: %w", err)
return "", fmt.Errorf("BytesToStr: error decoding bytes with %T: %w", decoder.Transformer, err)
}
return string(d), nil
}
Expand Down

0 comments on commit e822da7

Please sign in to comment.