From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: nisse@lysator.liu.se.?= (Niels =?UTF-8?Q?M=C3=B6ller) Newsgroups: gmane.emacs.bugs Subject: bug#5046: Too silent error reporting in imap.el:imap-open-1 Date: Thu, 26 Nov 2009 12:34:02 +0100 Message-ID: Reply-To: Niels =?UTF-8?Q?M=C3=B6ller , ?=.5046@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1259307074 15956 80.91.229.12 (27 Nov 2009 07:31:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 27 Nov 2009 07:31:14 +0000 (UTC) To: bug-gnu-emacs@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Nov 27 08:31:08 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1NDvIJ-0004t0-Gf for geb-bug-gnu-emacs@m.gmane.org; Fri, 27 Nov 2009 08:31:07 +0100 Original-Received: from localhost ([127.0.0.1]:46748 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NDvII-0005V0-R9 for geb-bug-gnu-emacs@m.gmane.org; Fri, 27 Nov 2009 02:31:06 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NDcos-0007GE-Lj for bug-gnu-emacs@gnu.org; Thu, 26 Nov 2009 06:47:30 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NDcon-0007EE-Qs for bug-gnu-emacs@gnu.org; Thu, 26 Nov 2009 06:47:29 -0500 Original-Received: from [199.232.76.173] (port=35716 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NDcon-0007E5-Ih for bug-gnu-emacs@gnu.org; Thu, 26 Nov 2009 06:47:25 -0500 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:51588) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NDcom-0002qT-Vg for bug-gnu-emacs@gnu.org; Thu, 26 Nov 2009 06:47:25 -0500 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nAQBlM2R012448; Thu, 26 Nov 2009 03:47:22 -0800 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id nAQBe5Bm011746; Thu, 26 Nov 2009 03:40:05 -0800 Resent-Date: Thu, 26 Nov 2009 03:40:05 -0800 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: nisse@lysator.liu.se.?= (Niels =?UTF-8?Q?M=C3=B6ller) Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs 2Resent-Date: Thu, 26 Nov 2009 11:40:04 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: report 5046 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by submit@emacsbugs.donarmstrong.com id=B.125923525711273 (code B ref -1); Thu, 26 Nov 2009 11:40:04 +0000 Original-Received: (at submit) by emacsbugs.donarmstrong.com; 26 Nov 2009 11:34:17 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nAQBYF7c011270 for ; Thu, 26 Nov 2009 03:34:16 -0800 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NDcc2-00071w-NB for bug-gnu-emacs@gnu.org; Thu, 26 Nov 2009 06:34:14 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NDcbw-0006v2-FG for bug-gnu-emacs@gnu.org; Thu, 26 Nov 2009 06:34:13 -0500 Original-Received: from [199.232.76.173] (port=44995 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NDcbv-0006tI-CF for bug-gnu-emacs@gnu.org; Thu, 26 Nov 2009 06:34:07 -0500 Original-Received: from mail.lysator.liu.se ([130.236.254.3]:47326) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NDcbt-0001FI-DE for bug-gnu-emacs@gnu.org; Thu, 26 Nov 2009 06:34:05 -0500 Original-Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id EBB4840019 for ; Thu, 26 Nov 2009 12:33:00 +0100 (CET) Original-Received: by mail.lysator.liu.se (Postfix, from userid 1674) id DD7CF400AE; Thu, 26 Nov 2009 12:33:00 +0100 (CET) Original-Received: from stalhein.lysator.liu.se (stalhein.lysator.liu.se [130.236.254.204]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.lysator.liu.se (Postfix) with ESMTP id AC8F740019 for ; Thu, 26 Nov 2009 12:33:00 +0100 (CET) Original-Received: from stalhein.lysator.liu.se (localhost [127.0.0.1]) by stalhein.lysator.liu.se (8.13.8+Sun/8.13.4) with ESMTP id nAQBY2r7025780 for ; Thu, 26 Nov 2009 12:34:02 +0100 (MET) Original-Received: (from nisse@localhost) by stalhein.lysator.liu.se (8.13.8+Sun/8.13.8/Submit) id nAQBY2vT025779; Thu, 26 Nov 2009 12:34:02 +0100 (MET) X-Authentication-Warning: stalhein.lysator.liu.se: nisse set sender to nisse@lysator.liu.se using -f User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (usg-unix-v) X-Virus-Scanned: ClamAV using ClamSMTP X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Thu, 26 Nov 2009 06:47:29 -0500 X-Mailman-Approved-At: Fri, 27 Nov 2009 02:20:11 -0500 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:32978 Archived-At: This is a problem that I experienced on emacs-22.3 on w*ndows, but the code in question seem to be identical in emacs-23. I tried to configure an nnimap server in Gnus, and connection failed, with a message imap: Connecting to the-mail-server.com...failed with no further details. The real error was hidden by the condition-case (setq imap-current-mailbox nil imap-current-message nil imap-state 'initial imap-process (condition-case () (funcall (nth 2 (assq imap-stream imap-stream-alist)) "imap" buffer imap-server imap-port) ((error quit) nil))) in imap.el:imap-open-1. After some debugging, involving adding some additional message calls in imap-open-1, I figured out the trivial source for the problem. A typo in my .gnus file, where I wrote nnimap-stream 'tls rather than nnimap-stream tls Now, (quote tls) is not present on the imap-stream alist, which results in an attempt to funcall nil. If I had received an error message like "(quote tls) is not a valid imap stream type", I would have solved the problem a lot quicker. I'd like to suggest that error reporting is improved as follows: 1. Messages of the form "Connecting to ... failed." should be used only when the actual problem is related to the network connection (dns errors, connection refused, possibly tls-related handshaking errors, etc). It's long time since I read the elisp documentation, so I'm not sure if there are some defined error symbols that make this case easy to distinguish from other errors. And in the case that the error is in fact network related, it would be helpful to have the message provide any details that are available, to aid investigation of the underlying networking problem. 2. When imap-stream is not found on the imap-stream-alist, this should either be reported in some human-friendly form, or it should raise an error which is not masked by condition case on the way up. This would typically indicate either a configuration error (like in my case), or a bug in whatever code using imap-open. If I had seen the void-function error for this particular funcall, that would also have pointed out the problem fairly accurately. 3. The data for the error should not be throuwn away. If nothing more sensibly can be done to it, even a crude change to imap-process (condition-case (e) (funcall (nth 2 (assq imap-stream imap-stream-alist)) "imap" buffer imap-server imap-port) ((quit) nil) ((error) (message "imap-open: unexpected error %s" e) nil))) would be an improvement. Regards, /Niels