Subject: Re: bug#51335: 29.0.50; Use warnings facility for reporting Gnus errors

From: Eric Abrahamsen <[email-masked]>
Date: Sat, 04 Dec 2021 12:42:18 -0800

Continuing a more piecemeal approach to this, here's a patch to change
the mail source error behavior. I'm floating it for review because it
involves removing a user-facing option. If this goes in, should that
removal be mentioned in NEWS?

>From 9d4359a72cd042a6357773c62fb70fc0c678a3cf Mon Sep 17 00:00:00 2001
From: Eric Abrahamsen <[email-masked]>
Date: Sat, 4 Dec 2021 12:37:14 -0800
Subject: [PATCH] Use gnus-error to report mail-source failures

* lisp/gnus/mail-source.el (mail-source-fetch): Instead of querying
the user on mail sources errors -- in effect asking "do you want to
continue, or halt the process?" -- log the error with `gnus-error',
severity 5. The query didn't provide any meaningful control; error
reporting is all that's needed.
(mail-source-ignore-errors): Obsolete this option; users can see the
error or not by configuring `gnus-verbose'.
* doc/misc/gnus.texi (Mail Source Customization): Remove mention of
the above option from the manual.
---
 doc/misc/gnus.texi       |  4 ----
 lisp/gnus/mail-source.el | 19 +++++++------------
 2 files changed, 7 insertions(+), 16 deletions(-)

diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi
index a18afec02e..6ffc057ba1 100644
--- a/doc/misc/gnus.texi
+++ b/doc/misc/gnus.texi
@@ -15447,10 +15447,6 @@ Mail Source Customization
 files.  This variable only applies when
 @code{mail-source-delete-incoming} is a positive number.
 
-@item mail-source-ignore-errors
-@vindex mail-source-ignore-errors
-If non-@code{nil}, ignore errors when reading mail from a mail source.
-
 @item mail-source-directory
 @vindex mail-source-directory
 Directory where incoming mail source files (if any) will be stored.  The
diff --git a/lisp/gnus/mail-source.el b/lisp/gnus/mail-source.el
index af0a198376..efdddea69f 100644
--- a/lisp/gnus/mail-source.el
+++ b/lisp/gnus/mail-source.el
@@ -224,12 +224,9 @@ mail-sources
 					   (const :format "" :value :plugged)
 					   (boolean :tag "Plugged"))))))))
 
-(defcustom mail-source-ignore-errors nil
-  "Ignore errors when querying mail sources.
-If nil, the user will be prompted when an error occurs.  If non-nil,
-the error will be ignored."
-  :version "22.1"
-  :type 'boolean)
+(make-obsolete-variable 'mail-source-ignore-errors
+                        "configure `gnus-verbose' instead"
+                        "29.1")
 
 (defcustom mail-source-primary-source nil
   "Primary source for incoming mail.
@@ -554,18 +551,16 @@ mail-source-fetch
 		 (condition-case err
 		     (funcall function source callback)
 		   (error
-		    (if (and (not mail-source-ignore-errors)
-			     (not
-			      (yes-or-no-p
-			       (format "Mail source %s error (%s).  Continue? "
+                    (gnus-error
+                     5
+                     (format "Mail source %s error (%s)"
 				       (if (memq ':password source)
 					   (let ((s (copy-sequence source)))
 					     (setcar (cdr (memq ':password s))
 						     "********")
 					     s)
 					 source)
-				       (cadr err)))))
-		      (error "Cannot get new mail"))
+				       (cadr err)))
 		    0)))))))))
 
 (declare-function gnus-message "gnus-util" (level &rest args))
-- 
2.34.1