From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.user/19096 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: gnus via info-gnus-english Newsgroups: gmane.emacs.gnus.user Subject: RE: How to trap an error when connecting to a news server Date: Sat, 04 Jan 2020 19:31:05 +0000 Message-ID: <1578166265275.914646@criptext.com> References: <1578146518407.757655@criptext.com> Reply-To: gnus Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2504442747019670131==" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="232331"; mail-complaints-to="usenet@blaine.gmane.org" Cc: info-gnus-english@gnu.org To: bobnewell@bobnewell.net Original-X-From: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Sat Jan 04 20:31:15 2020 Return-path: Envelope-to: gegu-info-gnus-english@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1inp8k-000yIN-Gm for gegu-info-gnus-english@m.gmane.org; Sat, 04 Jan 2020 20:31:14 +0100 Original-Received: from localhost ([::1]:36296 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1inp8j-00087Y-9O for gegu-info-gnus-english@m.gmane.org; Sat, 04 Jan 2020 14:31:13 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47770) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1inp8f-00087E-1a for info-gnus-english@gnu.org; Sat, 04 Jan 2020 14:31:10 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1inp8d-0007Ma-Ho for info-gnus-english@gnu.org; Sat, 04 Jan 2020 14:31:08 -0500 Original-Received: from smtp.criptext.com ([52.37.193.129]:33988) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1inp8d-0007Jx-6M for info-gnus-english@gnu.org; Sat, 04 Jan 2020 14:31:07 -0500 Original-Received: (Haraka outbound); Sat, 04 Jan 2020 19:31:06 +0000 Authentication-Results: smtp.criptext.com; auth=pass (plain) Original-Received: from [127.0.0.1] (ec2-34-221-2-169.us-west-2.compute.amazonaws.com [34.221.2.169]) by smtp.criptext.com (Haraka/2.8.20) with ESMTPSA id FFE14B78-441E-4289-A715-5BEECB51CB94.1 envelope-from (authenticated bits=0) (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES128-GCM-SHA256 verify=FAIL); Sat, 04 Jan 2020 19:31:05 +0000 In-Reply-To: <1578146518407.757655@criptext.com> DKIM-Signature: v=1; a=rsa-sha256; bh=+c8CB5P7Od1UxSume8londjM4pR76fr3HEYaMeg0Wg4=; c=relaxed/simple; d=criptext.com; h=from:subject:date:message-id:to:cc:mime-version; s=criptext; b=fh65ceHeVPpnLVpIoCIl1ST52LPAt7m8Ox6XJwpSCwZ2TEmAX96hyCxqLxI6/CCM6WFkvt3zD5xMQ2apr8/hHUMEShXo5ennLXw0XhbErNLmPTOXtP/WmkCSqtEAWlKai6rEcrOjkLD8Vkf39wBi73/0U8Ul8siYgjh+1rCV4LIE679wo6tFbCCIx4SpfTgp7eYNVq4ZuKAvZvUbmrez6L48f/MSpDVg5ZI5O3GtpI/RPPjrvf+TpX9oijUZLjeLqagk7yHTDdCRGefMx4pQsrNFMYq5W39sKo7r9CRxapYuFXuEjd4R9zFvLxokM8+mG29f5IknT1y6slYQQFw77Q== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 52.37.193.129 X-BeenThere: info-gnus-english@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Announcements and discussions for GNUS, the GNU Emacs Usenet newsreader \(in English\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Original-Sender: "info-gnus-english" Xref: news.gmane.org gmane.emacs.gnus.user:19096 Archived-At: --===============2504442747019670131== Content-Type: multipart/alternative; boundary="--_NmP-cde4e14190024a7f-Part_1" ----_NmP-cde4e14190024a7f-Part_1 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Sat, 4 Jan 2020 at 7:09 PM, Bob Newell < bobnewell@bobnewell.net > = wrote:> >=20 (defun news-check () (condition-case err (message "The result is %s" (gnus-group-get-new-news)) (news-error (message "I expect the server closed again %s",err) ) ) ) I could be mistaken in this, but in your code above, where did you get 'news-error' as the name of the error condition raised? I can't find this anywhere in the gnus source tree. Do you know for sure that gnus-group-get-new-news (or anything it calls) raises that condition? Thank you for your response. It is useful to me that you ask this. I could = not tell from the manual that "arith-error" in the example had a specific = meaning, so I arbitrarily changed it. https://www.gnu.= org/software/emacs/manual/html_node/elisp/Handling-Errors.html How do I tell what the error condition will be? The code in nntp.el is this= (I think this is where the server closed condition occurs) : (defun nntp-report (&rest args) "Report an error from the nntp backend. The= first string in ARGS can be a format string. For some commands, the failed= command may be retried once before actually displaying the error report." (if nntp--report-1 (progn ;; Throw out to nntp-with-open-group-error so = that the connection may ;; be restored and the command retried." (when nntp-record-commands (nntp-record-command "*** CONNECTION LOST ***")) (throw 'nntp-with-open-group-error t)) (when nntp-record-commands (nntp-record-command "*** CALLED nntp-report ***")) (nnheader-report 'nntp args) (apply 'error args) )) [https://api.criptext.com/email/open/%3C1578166265275.914646%40criptext.= com%3E] ----_NmP-cde4e14190024a7f-Part_1 Content-Type: text/html Content-Transfer-Encoding: quoted-printable

O= n Sat, 4 Jan 2020 at 7:09 PM, Bob Newell < bobnewell@bobnewell.net > = wrote:

(defun news-check = () 
 (condition-case err 
    &nbs= p;(message "The result is %s" (gnus-group-get-new-news)) 
 &nb= sp; (news-error 
    (message "I expect = the server closed again %s",err) 
    )    ) 


I could be mistaken in this, but in your code above, where did = you get 'news-error' as the name of the error condition raised? I can't = find this anywhere in the gnus source tree. Do you know for sure that = gnus-group-get-new-news (or anything it calls) raises that condition?=

Thank you for your response. It is = useful to me that you ask this. I could not tell from the manual that = "arith-error" in the example had a specific meaning, so I arbitrarily = changed it.

https://www.gnu.org/software/emacs/manua= l/html_node/elisp/Handling-Errors.html

How do = I tell what the error condition will be? The code in nntp.el is this (I = think this is where the server closed condition occurs) = :

(defun nntp-report (&rest args) =             &nb= sp;            =             &nb= sp;            =             &nb= sp;            =             &nb= sp;            
=  "Repor= t an error from the nntp backend.  The first string in ARGS =             &nb= sp;            =             &nb= sp;            =             &nb= sp; 
can be a format string.  For some commands, the failed command may be=             &n= bsp;            = ;            &n= bsp;            = ;           &= nbsp;
retried = once before actually displaying the error report."     &n= bsp;            = ;            &n= bsp;            = ;            &n= bsp;            = ;      
 (if nntp--report-1 =             &nb= sp;            =             &nb= sp;            =             &nb= sp;            =             &nb= sp;            =             =      (progn           &n= bsp;            = ;            &n= bsp;            = ;            &n= bsp;            = ;            &n= bsp;            = ;            &n= bsp;        
    &n= bsp;  ;; Throw out to nntp-with-open-group-error so that the connection may =             &nb= sp;            =             &nb= sp;            =     
       ;; be restored and the = command retried."          &nb= sp;            =             &nb= sp;            =             &nb= sp;            =             =        (when nntp-record-commands =             &nb= sp;            =             &nb= sp;            =             &nb= sp;            =             &nb= sp;         
    &n= bsp;    (nntp-record-command "*** CONNECTION LOST = ***")) =             &nb= sp;            =             &nb= sp;            =             &nb= sp;          
<= span style=3D"background-color: rgb(255, 215, 135);"> =        (
throw 'nntp-with-open-group-erro= r t)) =             &nb= sp;            =             &nb= sp;            =             &nb= sp;            =           
    =             &nb= sp;            =             &nb= sp;            =             &nb= sp;            =             &nb= sp;            =             &nb= sp;            =  
 
   (when nntp-record-commands        &nbs= p;            &= nbsp;           &nbs= p;            &= nbsp;           &nbs= p;            &= nbsp;           &nbs= p;            &= nbsp;     
    &n= bsp;(nntp-record-command "*** CALLED nntp-report ***"))     =             &nb= sp;            =             &nb= sp;            =             &nb= sp;       
    &n= bsp;            = ;            &n= bsp;            = ;            &n= bsp;            = ;            &n= bsp;            = ;            &n= bsp;            = ;            &n= bsp; 
=    (nnheader-report 'nntp args)     &nb= sp;            =             &nb= sp;            =             &nb= sp;            =             &nb= sp;            =        
    &n= bsp;            = ;            &n= bsp;            = ;            &n= bsp;            = ;            &n= bsp;            = ;            &n= bsp;            = ;            &n= bsp; 
=    (apply 'error args)       =             &nb= sp;            =             &nb= sp;            =             &nb= sp;            =             &nb= sp;            =   
   ))        &nbs= p;            &= nbsp;           &nbs= p;            &= nbsp;           &nbs= p;            &= nbsp;           &nbs= p;            &= nbsp;           &nbs= p;            &= nbsp;    



----_NmP-cde4e14190024a7f-Part_1-- --===============2504442747019670131== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KaW5mby1nbnVz LWVuZ2xpc2ggbWFpbGluZyBsaXN0CmluZm8tZ251cy1lbmdsaXNoQGdudS5vcmcKaHR0cHM6Ly9s aXN0cy5nbnUub3JnL21haWxtYW4vbGlzdGluZm8vaW5mby1nbnVzLWVuZ2xpc2gK --===============2504442747019670131==--