unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#5046: Too silent error reporting in imap.el:imap-open-1
@ 2009-11-26 11:34 Niels =?UTF-8?Q?M=C3=B6ller
  2011-09-18  9:27 ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 3+ messages in thread
From: Niels =?UTF-8?Q?M=C3=B6ller @ 2009-11-26 11:34 UTC (permalink / raw)
  To: bug-gnu-emacs

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 <some host>... 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






^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: bug#5046: Too silent error reporting in imap.el:imap-open-1
       [not found] <mailman.11620.1259306412.2239.bug-gnu-emacs@gnu.org>
@ 2011-02-11 20:32 ` Ted Zlatanov
  0 siblings, 0 replies; 3+ messages in thread
From: Ted Zlatanov @ 2011-02-11 20:32 UTC (permalink / raw)
  To: bug-gnu-emacs

On Thu, 26 Nov 2009 12:34:02 +0100 nisse@lysator.liu.se.?= (Niels =?UTF-8?Q?M=C3=B6ller) wrote: 

N> This is a problem that I experienced on emacs-22.3 on w*ndows, but the
N> code in question seem to be identical in emacs-23.

N> I tried to configure an nnimap server in Gnus, and connection failed,
N> with a message

N>   imap: Connecting to the-mail-server.com...failed

N> with no further details.

Hi Niels,

the latest Gnus doesn't use imap.el anymore and I am trying to remove
anything that uses that library.  The new nnimap.el does all the IMAP
work internally and I think will DTRT for your case.

Ted


^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#5046: Too silent error reporting in imap.el:imap-open-1
  2009-11-26 11:34 bug#5046: Too silent error reporting in imap.el:imap-open-1 Niels =?UTF-8?Q?M=C3=B6ller
@ 2011-09-18  9:27 ` Lars Magne Ingebrigtsen
  0 siblings, 0 replies; 3+ messages in thread
From: Lars Magne Ingebrigtsen @ 2011-09-18  9:27 UTC (permalink / raw)
  To: Niels Möller; +Cc: 5046

nisse@lysator.liu.se (Niels Möller) writes:

> I tried to configure an nnimap server in Gnus, and connection failed,
> with a message
>
>   imap: Connecting to the-mail-server.com...failed

This has been fixed in Emacs 24, where IMAP failures should give better
error messages.

-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-09-18  9:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-26 11:34 bug#5046: Too silent error reporting in imap.el:imap-open-1 Niels =?UTF-8?Q?M=C3=B6ller
2011-09-18  9:27 ` Lars Magne Ingebrigtsen
     [not found] <mailman.11620.1259306412.2239.bug-gnu-emacs@gnu.org>
2011-02-11 20:32 ` Ted Zlatanov

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).