GNU bug report logs -
#19768
json.el: end-of-file errors untrappable
Previous Next
Reported by: era eriksson <era <at> iki.fi>
Date: Wed, 4 Feb 2015 14:00:02 UTC
Severity: normal
Found in version 24.3.1
Done: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Package: emacs
Version: 24.3.1
X-Debbugs-Cc: era+emacs <at> iki.fi
The code in json.el uses (signal 'end-of-file) in many scenarios.
Unfortunately, the default value of debug-ignore-errors causes these
errors to bypass any error checking, and unhelpfully land in the
*Messages* buffer with little indication as to what went wrong or which
code path caused this message.
Once you know this, debugging json-read is easy; but the fix is
unobvious, and might have unintended side effects.
Steps to repro:
(require 'json)
(setq debug-on-error t)
(json-read-from-string "")
Expected result:
*Backtrace* showing where something went wrong
Actual result:
json-read: End of file during parsing
(The "json-read:" prefix is not visible in the minibuffer message for
me, but it lands in the *Messages* buffer.)
Workaround:
(let (debug-ignore-errors)
(json-read-from-string ""))
I'm not sure what the proper fix should be. Maybe these occurrences
could be changed to json-end-of-file or something? Or maybe json-read
could include the 'let' form from the workaround.
See also:
http://stackoverflow.com/questions/28317081/debug-on-error-vs-debug-on-signal-in-json-el-in-particular
/* era */
--
If this were a real .signature, it would suck less. Well, maybe not.
This bug report was last modified 10 years and 169 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.