From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Richard Copley Newsgroups: gmane.emacs.bugs Subject: bug#25735: 26.0.50; url-retrieve errors are peculiar Date: Tue, 14 Feb 2017 21:21:48 +0000 Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: blaine.gmane.org 1487107396 27229 195.159.176.226 (14 Feb 2017 21:23:16 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 14 Feb 2017 21:23:16 +0000 (UTC) To: 25735@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Feb 14 22:23:06 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cdkYy-0006VH-VE for geb-bug-gnu-emacs@m.gmane.org; Tue, 14 Feb 2017 22:23:05 +0100 Original-Received: from localhost ([::1]:37218 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cdkZ4-0003OP-5p for geb-bug-gnu-emacs@m.gmane.org; Tue, 14 Feb 2017 16:23:10 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46216) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cdkYx-0003O6-9O for bug-gnu-emacs@gnu.org; Tue, 14 Feb 2017 16:23:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cdkYw-0007BJ-6r for bug-gnu-emacs@gnu.org; Tue, 14 Feb 2017 16:23:03 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:42089) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cdkYw-0007BA-48 for bug-gnu-emacs@gnu.org; Tue, 14 Feb 2017 16:23:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cdkYv-0002Jz-Ue for bug-gnu-emacs@gnu.org; Tue, 14 Feb 2017 16:23:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Richard Copley Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 14 Feb 2017 21:23:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 25735 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: "bug-gnu-emacs@gnu.org" Original-Received: via spool by submit@debbugs.gnu.org id=B.14871073518867 (code B ref -1); Tue, 14 Feb 2017 21:23:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 14 Feb 2017 21:22:31 +0000 Original-Received: from localhost ([127.0.0.1]:40288 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cdkYR-0002Ix-CQ for submit@debbugs.gnu.org; Tue, 14 Feb 2017 16:22:31 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:55140) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cdkYP-0002Ik-OU for submit@debbugs.gnu.org; Tue, 14 Feb 2017 16:22:30 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cdkYJ-00075r-8E for submit@debbugs.gnu.org; Tue, 14 Feb 2017 16:22:24 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:53915) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cdkYJ-00075n-5C for submit@debbugs.gnu.org; Tue, 14 Feb 2017 16:22:23 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46109) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cdkYH-0003NJ-R0 for bug-gnu-emacs@gnu.org; Tue, 14 Feb 2017 16:22:22 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cdkYG-00075Y-Pa for bug-gnu-emacs@gnu.org; Tue, 14 Feb 2017 16:22:21 -0500 Original-Received: from mail-ua0-x22d.google.com ([2607:f8b0:400c:c08::22d]:33988) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cdkYG-00074y-LR for bug-gnu-emacs@gnu.org; Tue, 14 Feb 2017 16:22:20 -0500 Original-Received: by mail-ua0-x22d.google.com with SMTP id 35so94733288uak.1 for ; Tue, 14 Feb 2017 13:22:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=FcmIQabtooQmQwHHEkV150cxLHJcakbqcYl/ic2Wemo=; b=Jbbm3GbG4/Aof8DK03vEh6hNI6AXFmMlNhuLfGevQ9pqENnhZ1xEte26lYdmeLY+Dk dkleGCZ8F5702N00Wf6cg4RauJMm7wCd4H2xL+QAMiizJQ+ySf2OVtcRzs/S8Da+6kJT kEQjHcEvH05pPALlP+edvNoC4YeW5368X7LC6B7Kmo72cVOICuo4QmT7wLhLImDAHfwF AOdVTdXzL+/BpbYiM+trn7akSkTCnZFe8yEt1kTXgnFfQdMebwGMMAx7BrkbTc+B40XB 2xr/SnQsEHe+VZj5u4BVLg14retg+WQWZfgkYR3wXIjgG7ntscFMvx4aVIQK2puC3mf/ hROQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=FcmIQabtooQmQwHHEkV150cxLHJcakbqcYl/ic2Wemo=; b=V6WTv3s+VCoglDNxktyXqEYfYyk61HzjK60dX+VjOeCTznjYDzi8IC0Dr6SC7BLbgy a1eBSwfaHXkJBuDq+tlrXKrN887RO7I/b165vbsh3IMhw8m/UDvl5zcTXv/Hf4p089iF 068b5pK4Nu9vghGcF+MZZ8d2UZR3NuCTfnXEpcD7qXE2TnMt0xIyZ3vKCYEoRpJnk3wX mTpsU+ZExgf/qzjmjR5887I0qE9QAAGGro1XCGfOrY4ziRv9ApsIg7nu5hE0NbCcvyZZ X1+99YbMkl46xR8qtIPUJvRM154nc3DtAZhW0ASODAxl0+vhvxBlmoB7lUjzHqTLaFqq JAiw== X-Gm-Message-State: AMke39mudMX0WSg1yeEoSRGoccuSgWWMc7oM7+qYGjElbAa8L011AEzjGAzrqveJ5X1r+R1IVH9cdg2ug8mzcg== X-Received: by 10.159.49.66 with SMTP id n2mr16986551uab.72.1487107338332; Tue, 14 Feb 2017 13:22:18 -0800 (PST) Original-Received: by 10.176.82.239 with HTTP; Tue, 14 Feb 2017 13:21:48 -0800 (PST) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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" Xref: news.gmane.org gmane.emacs.bugs:129363 Archived-At: Within the docstring for url-retrieve, it says: "[...] The error can be signaled with (signal ERROR-SYMBOL DATA) [...]", but in current master (grep for ":error" in "lisp/url/*.el") the actual usage is that ERROR-SYMBOL is `error' and DATA is a list that starts with a symbol, for example (connection-failed "failed with code 10061" :host "localhost" :service 80). The docstring hints at something like this: (url-retrieve (format "http://localhost/non-existent-resource") (lambda (status &rest args) (let ((error-info (plist-get status :error))) (when error-info (signal (car error-info) (cdr error-info)))) ;;... )) which ends up calling this: (signal 'error '(connection-failed "failed with code 10061" :host "localhost" :service 80)) which ends up printing these two lines (including the newline embedded in a string) to the echo area: error in process sentinel: peculiar error: "failed with code 10061 ", :host, "localhost", :service, 80 Unfortunately the error code itself, `connection-failed', is dropped. (See print_error_message in "print.c"; if ERROR-SYMBOL is `error' then the car of DATA, say ERRMSG, is printed if it is a string; if ERRMSG is not a string then "peculiar error" is printed instead of ERRMSG.) Please also consider augmenting the docstring with an example of using the error data. It's a drag for the user to have to work that out before they are in a position to call url-retrieve! (There's a tiny example above, but of course it assumes that DATA has been changed to conform to the docstring.)