diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2023-01-27 01:24:02 -0700 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2023-02-10 21:54:37 -0700 |
commit | 49415d88cdd0eed102627369bfdf9de78d0e8bed (patch) | |
tree | 0ec8a2d602eb234a37c0d39906e4c645e6b8bac8 /reencode.go | |
parent | cf8f8527e968c448995bdcaaad9c4351d3a2ab3f (diff) |
tree-wide: Audit panic error messages
These shouldn't happen, but if they do, then let's make it easier to
debug.
Diffstat (limited to 'reencode.go')
-rw-r--r-- | reencode.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/reencode.go b/reencode.go index 232d91d..e48c58c 100644 --- a/reencode.go +++ b/reencode.go @@ -519,7 +519,7 @@ func (enc *ReEncoder) handleRuneMain(c rune, t jsonparse.RuneType) error { case 't': err = enc.emit(writeStringChar(enc.out, '\t', BackslashEscapeShort, enc.BackslashEscape)) default: - panic("should not happen") + panic(fmt.Errorf("should not happen: rune %q is not a RuneTypeStringEsc1", c)) } case jsonparse.RuneTypeStringEscUA: enc.uhex[0], _ = jsonparse.HexToInt(c) |