* PATCH: Make nnrss fail gracefully when it can't fetch a feed
@ 2005-12-21 17:57 Mark Plaksin
2005-12-21 18:28 ` Mark Plaksin
2005-12-22 3:38 ` Katsumi Yamaoka
0 siblings, 2 replies; 7+ messages in thread
From: Mark Plaksin @ 2005-12-21 17:57 UTC (permalink / raw)
[-- Attachment #1: Type: text/plain, Size: 474 bytes --]
When nnrss can't fetch a feed an error is signalled. This patch makes
nnrss print a warning instead.
When you use 'g' from the Group buffer, the current behavior prevents the
rest of your feeds from being checked. The root cause is the use of
`(error)' in mm-url-insert-file-contents-external. This patch just adds a
condition-case in nnrss.el.
I don't know whether I used the right -message function. What's the
difference between nnheader-message and gnus-message?
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: nnrss.el --]
[-- Type: text/x-patch, Size: 569 bytes --]
--- nnrss.el.orig 2005-12-21 12:43:03.000000000 -0500
+++ nnrss.el 2005-12-21 12:43:13.000000000 -0500
@@ -380,7 +380,9 @@
;; FIXME: shouldn't binding `coding-system-for-read' be moved
;; to `mm-url-insert'?
(let ((coding-system-for-read 'binary))
- (mm-url-insert url)))
+ (condition-case nil
+ (mm-url-insert url)
+ (error (nnheader-message 3 "nnrss: Failed to fetch %s" url)))))
(nnheader-remove-cr-followed-by-lf)
;; Decode text according to the encoding attribute.
(when (setq cs (nnrss-get-encoding))
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: PATCH: Make nnrss fail gracefully when it can't fetch a feed
2005-12-21 17:57 PATCH: Make nnrss fail gracefully when it can't fetch a feed Mark Plaksin
@ 2005-12-21 18:28 ` Mark Plaksin
2005-12-22 3:38 ` Katsumi Yamaoka
1 sibling, 0 replies; 7+ messages in thread
From: Mark Plaksin @ 2005-12-21 18:28 UTC (permalink / raw)
Mark Plaksin <happy@mcplaksin.org> writes:
> When nnrss can't fetch a feed an error is signalled. This patch makes
> nnrss print a warning instead.
>
> When you use 'g' from the Group buffer, the current behavior prevents the
> rest of your feeds from being checked. The root cause is the use of
> `(error)' in mm-url-insert-file-contents-external. This patch just adds a
> condition-case in nnrss.el.
PS: To test what happens when nnrss can't fetch a site, make an /etc/hosts
entry for the hostname of one of your feeds that points to a machine that's
not running a web server (I used 127.0.0.0).
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: PATCH: Make nnrss fail gracefully when it can't fetch a feed
2005-12-21 17:57 PATCH: Make nnrss fail gracefully when it can't fetch a feed Mark Plaksin
2005-12-21 18:28 ` Mark Plaksin
@ 2005-12-22 3:38 ` Katsumi Yamaoka
2005-12-22 13:50 ` Mark Plaksin
1 sibling, 1 reply; 7+ messages in thread
From: Katsumi Yamaoka @ 2005-12-22 3:38 UTC (permalink / raw)
>>>>> In <87y82e1gg2.fsf@stone.tss.usg.edu> Mark Plaksin wrote:
> When nnrss can't fetch a feed an error is signalled. This patch makes
> nnrss print a warning instead.
> When you use 'g' from the Group buffer, the current behavior prevents the
> rest of your feeds from being checked. The root cause is the use of
> `(error)' in mm-url-insert-file-contents-external. This patch just adds a
> condition-case in nnrss.el.
> - (mm-url-insert url)))
> + (condition-case nil
> + (mm-url-insert url)
> + (error (nnheader-message 3 "nnrss: Failed to fetch %s" url)))))
Isn't it better to use just `message' since it is obviously an
error? And also (sit-for N) might be required.
> I don't know whether I used the right -message function. What's the
> difference between nnheader-message and gnus-message?
AFAIK, gnus- modules, mm- modules, nn- modules, and others are
mutually independent. For example, there might be people who
use nn- modules for the application other than Gnus. (They
depend each other in practice, though.)
BTW, you'd better do the paper work for the copyright assignment
on Emacs (or Gnus) because the remainder of your `tiny change'
quota will be used up sooner or later. ;-)
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: PATCH: Make nnrss fail gracefully when it can't fetch a feed
2005-12-22 3:38 ` Katsumi Yamaoka
@ 2005-12-22 13:50 ` Mark Plaksin
2005-12-22 14:49 ` Katsumi Yamaoka
0 siblings, 1 reply; 7+ messages in thread
From: Mark Plaksin @ 2005-12-22 13:50 UTC (permalink / raw)
Katsumi Yamaoka <yamaoka@jpl.org> writes:
>> - (mm-url-insert url)))
>> + (condition-case nil
>> + (mm-url-insert url)
>> + (error (nnheader-message 3 "nnrss: Failed to fetch %s" url)))))
>
> Isn't it better to use just `message' since it is obviously an
> error? And also (sit-for N) might be required.
Hmm, maybe everybody isn't like me and there should be an option for error
handling :) I want a warning instead of an error because various feeds are
often inaccessible for some reasons beyond my control. As-is, Gnus stops
checking groups as soon as nnrss has an error and I don't know an easy way
to say "don't check group X this time around but check all the rest".
Some folks might want an error so that they it's obvious they are missing a
feed. I'll notice if I haven't read a feed for a long time so a warning
with no delay is best for me.
A warning is also be better than an error (for me) if fetching feeds via
a gnus-demon.
I won't have time to work on this for a week or so.
>> I don't know whether I used the right -message function. What's the
>> difference between nnheader-message and gnus-message?
>
> AFAIK, gnus- modules, mm- modules, nn- modules, and others are
> mutually independent. For example, there might be people who
> use nn- modules for the application other than Gnus. (They
> depend each other in practice, though.)
So nnheader-message is a general message function for all backends?
> BTW, you'd better do the paper work for the copyright assignment
> on Emacs (or Gnus) because the remainder of your `tiny change'
> quota will be used up sooner or later. ;-)
Ha! Are there really separate papers for Gnus and Emacs? Where does one
find the magical papers? They are mentioned but not present here:
http://www.gnu.org/prep/maintain/html_node/Copyright-Papers.html#Copyright-Papers
If it's all the same to the FSF, I'd just as soon do the one that includes
future changes.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: PATCH: Make nnrss fail gracefully when it can't fetch a feed
2005-12-22 13:50 ` Mark Plaksin
@ 2005-12-22 14:49 ` Katsumi Yamaoka
2005-12-31 15:49 ` Mark Plaksin
0 siblings, 1 reply; 7+ messages in thread
From: Katsumi Yamaoka @ 2005-12-22 14:49 UTC (permalink / raw)
>>>>> In <87r785nsu6.fsf@stone.tss.usg.edu>
>>>>> Mark Plaksin <happy@usg.edu> wrote:
> Katsumi Yamaoka <yamaoka@jpl.org> writes:
>>> - (mm-url-insert url)))
>>> + (condition-case nil
>>> + (mm-url-insert url)
>>> + (error (nnheader-message 3 "nnrss: Failed to fetch %s" url)))))
>>
>> Isn't it better to use just `message' since it is obviously an
>> error? And also (sit-for N) might be required.
I meant we can use `message' instead of `nnheader-message' there
as the following:
(condition-case nil
(mm-url-insert url)
(error (message "nnrss: Failed to fetch %s" url)))
I never said that we should use `error' instead of
`nnheader-message'.
> Hmm, maybe everybody isn't like me and there should be an option for error
> handling :) I want a warning instead of an error because various feeds are
> often inaccessible for some reasons beyond my control. As-is, Gnus stops
> checking groups as soon as nnrss has an error and I don't know an easy way
> to say "don't check group X this time around but check all the rest".
> Some folks might want an error so that they it's obvious they are missing a
> feed. I'll notice if I haven't read a feed for a long time so a warning
> with no delay is best for me.
> A warning is also be better than an error (for me) if fetching feeds via
> a gnus-demon.
> I won't have time to work on this for a week or so.
>>> I don't know whether I used the right -message function. What's the
>>> difference between nnheader-message and gnus-message?
>>
>> AFAIK, gnus- modules, mm- modules, nn- modules, and others are
>> mutually independent. For example, there might be people who
>> use nn- modules for the application other than Gnus. (They
>> depend each other in practice, though.)
> So nnheader-message is a general message function for all backends?
Or `message' is, I think.
>> BTW, you'd better do the paper work for the copyright assignment
>> on Emacs (or Gnus) because the remainder of your `tiny change'
>> quota will be used up sooner or later. ;-)
> Ha! Are there really separate papers for Gnus and Emacs?
AFAIK, a paper for Emacs applies to all that programs the Emacs
includes.
> Where does one
> find the magical papers? They are mentioned but not present here:
> http://www.gnu.org/prep/maintain/html_node/Copyright-Papers.html#Copyright-Papers
> If it's all the same to the FSF, I'd just as soon do the one that includes
> future changes.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: PATCH: Make nnrss fail gracefully when it can't fetch a feed
2005-12-22 14:49 ` Katsumi Yamaoka
@ 2005-12-31 15:49 ` Mark Plaksin
2006-01-01 6:46 ` Katsumi Yamaoka
0 siblings, 1 reply; 7+ messages in thread
From: Mark Plaksin @ 2005-12-31 15:49 UTC (permalink / raw)
Katsumi Yamaoka <yamaoka@jpl.org> writes:
>>>>>> In <87r785nsu6.fsf@stone.tss.usg.edu>
>>>>>> Mark Plaksin <happy@usg.edu> wrote:
>
>> Katsumi Yamaoka <yamaoka@jpl.org> writes:
>
>>>> - (mm-url-insert url)))
>>>> + (condition-case nil
>>>> + (mm-url-insert url)
>>>> + (error (nnheader-message 3 "nnrss: Failed to fetch %s" url)))))
>>>
>>> Isn't it better to use just `message' since it is obviously an
>>> error? And also (sit-for N) might be required.
>
> I meant we can use `message' instead of `nnheader-message' there
> as the following:
>
> (condition-case nil
> (mm-url-insert url)
> (error (message "nnrss: Failed to fetch %s" url)))
>
> I never said that we should use `error' instead of
> `nnheader-message'.
OK, I misread or misunderstood. `message' sounds good to me!
mm-url-insert is also called in nnrss-insert-w3. I guess there should be a
condition-case there too but I don't understand what nnrss-insert-w3 is for.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: PATCH: Make nnrss fail gracefully when it can't fetch a feed
2005-12-31 15:49 ` Mark Plaksin
@ 2006-01-01 6:46 ` Katsumi Yamaoka
0 siblings, 0 replies; 7+ messages in thread
From: Katsumi Yamaoka @ 2006-01-01 6:46 UTC (permalink / raw)
>>>>> In <87zmmhfeqs.fsf@stone.tss.usg.edu>
>>>>> Mark Plaksin <happy@usg.edu> wrote:
> OK, I misread or misunderstood. `message' sounds good to me!
Thanks. I've done so.
> mm-url-insert is also called in nnrss-insert-w3. I guess there should be a
> condition-case there too but I don't understand what nnrss-insert-w3 is for.
Done. AFAIK, nnrss-insert-w3 is used when browsing the nnrss
server like `B nnrss RET RET y'. I've never conveniently used
it, though.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2006-01-01 6:46 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-12-21 17:57 PATCH: Make nnrss fail gracefully when it can't fetch a feed Mark Plaksin
2005-12-21 18:28 ` Mark Plaksin
2005-12-22 3:38 ` Katsumi Yamaoka
2005-12-22 13:50 ` Mark Plaksin
2005-12-22 14:49 ` Katsumi Yamaoka
2005-12-31 15:49 ` Mark Plaksin
2006-01-01 6:46 ` Katsumi Yamaoka
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 NNTP newsgroup(s).