summaryrefslogtreecommitdiff
path: root/reencode.go
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2023-01-27 01:24:02 -0700
committerLuke Shumaker <lukeshu@lukeshu.com>2023-02-10 21:54:37 -0700
commit49415d88cdd0eed102627369bfdf9de78d0e8bed (patch)
tree0ec8a2d602eb234a37c0d39906e4c645e6b8bac8 /reencode.go
parentcf8f8527e968c448995bdcaaad9c4351d3a2ab3f (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.go2
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)