From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: era eriksson Newsgroups: gmane.emacs.bugs Subject: bug#19768: json.el: end-of-file errors untrappable Date: Wed, 04 Feb 2015 15:59:43 +0200 Message-ID: <1423058383.3713286.222999749.0FE1B22B@webmail.messagingengine.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1423058429 21533 80.91.229.3 (4 Feb 2015 14:00:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 4 Feb 2015 14:00:29 +0000 (UTC) Cc: era+emacs@iki.fi To: 19768@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Feb 04 15:00:28 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YJ0VD-0001ai-Az for geb-bug-gnu-emacs@m.gmane.org; Wed, 04 Feb 2015 15:00:23 +0100 Original-Received: from localhost ([::1]:36539 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YJ0VC-0006uU-QL for geb-bug-gnu-emacs@m.gmane.org; Wed, 04 Feb 2015 09:00:22 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46303) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YJ0Uy-0006oS-NO for bug-gnu-emacs@gnu.org; Wed, 04 Feb 2015 09:00:14 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YJ0Uu-0008Mz-M6 for bug-gnu-emacs@gnu.org; Wed, 04 Feb 2015 09:00:08 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:42304) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YJ0Uu-0008M9-Fg for bug-gnu-emacs@gnu.org; Wed, 04 Feb 2015 09:00:04 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YJ0Us-0008RY-SJ; Wed, 04 Feb 2015 09:00:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: era eriksson Original-Sender: "Debbugs-submit" Resent-CC: era+emacs@iki.fi, bug-gnu-emacs@gnu.org Resent-Date: Wed, 04 Feb 2015 14:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 19768 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: submit@debbugs.gnu.org X-Debbugs-Original-Xcc: era+emacs@iki.fi Original-Received: via spool by submit@debbugs.gnu.org id=B.142305838632398 (code B ref -1); Wed, 04 Feb 2015 14:00:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 4 Feb 2015 13:59:46 +0000 Original-Received: from localhost ([127.0.0.1]:33543 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YJ0Ub-0008QU-UW for submit@debbugs.gnu.org; Wed, 04 Feb 2015 08:59:46 -0500 Original-Received: from out1-smtp.messagingengine.com ([66.111.4.25]:32939) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YJ0Ua-0008QM-A4 for submit@debbugs.gnu.org; Wed, 04 Feb 2015 08:59:45 -0500 Original-Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id C335820A9C for ; Wed, 4 Feb 2015 08:59:43 -0500 (EST) Original-Received: from web5 ([10.202.2.215]) by compute3.internal (MEProxy); Wed, 04 Feb 2015 08:59:43 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=message-id:x-sasl-enc:from:to :mime-version:content-transfer-encoding:content-type:subject :date; s=smtpout; bh=0PyhP+vlxUGi7CH/0mxsnasu66A=; b=dD1y4wbVY8f jdcoAbf2h5s6OvHbfDYs9v3vDHOg0VphTaqhxC9w7H7RODSvyNcKbzyn2EPc1HG8 2Gny5yt3vVHvjCmLfV6fntNmOe/9L5lytgtkgUAvhYw+KqGa6e0kPc8JlHVeHyYb BK+fKYd0TViSKd+wZ3TVBnFOdIEwMgWc= Original-Received: by web5.nyi.internal (Postfix, from userid 99) id 993B2B644B2; Wed, 4 Feb 2015 08:59:43 -0500 (EST) X-Sasl-Enc: GwU4iU/6aqXMVTO14uBSJhfHRwCOpNw8JdzVrfskFfHC 1423058383 X-Mailer: MessagingEngine.com Webmail Interface - ajax-b6284d51 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:99029 Archived-At: Package: emacs Version: 24.3.1 X-Debbugs-Cc: era+emacs@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.