GNU bug report logs - #22160
24.5; "M-x browse-url-emacs" on a 404 page

Previous Next

Package: emacs;

Reported by: Alex Kost <alezost <at> gmail.com>

Date: Sun, 13 Dec 2015 10:40:02 UTC

Severity: normal

Found in version 24.5

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 22160 in the body.
You can then email your comments to 22160 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#22160; Package emacs. (Sun, 13 Dec 2015 10:40:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Alex Kost <alezost <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 13 Dec 2015 10:40:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Alex Kost <alezost <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.5; "M-x browse-url-emacs" on a 404 page
Date: Sun, 13 Dec 2015 13:39:13 +0300
Hello, I've noticed an unhandled error when I tried the following:

1. emacs -Q
2. M-x browse-url-emacs RET http://hydra.gnu.org/build/12345

And the error is:

    find-file-noselect-1: Wrong type argument: arrayp, nil

As (file-truename buffer-file-name) fails when buffer-file-name is nil.

It would be good to have a more "friendly" error, like the one that
(url-insert-file-contents "http://hydra.gnu.org/build/12345") produces.

Thanks.

-- 
Alex




Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Sat, 19 Dec 2015 10:02:02 GMT) Full text and rfc822 format available.

Notification sent to Alex Kost <alezost <at> gmail.com>:
bug acknowledged by developer. (Sat, 19 Dec 2015 10:02:02 GMT) Full text and rfc822 format available.

Message #10 received at 22160-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Alex Kost <alezost <at> gmail.com>
Cc: 22160-done <at> debbugs.gnu.org
Subject: Re: bug#22160: 24.5; "M-x browse-url-emacs" on a 404 page
Date: Sat, 19 Dec 2015 12:01:43 +0200
> From: Alex Kost <alezost <at> gmail.com>
> Date: Sun, 13 Dec 2015 13:39:13 +0300
> 
> Hello, I've noticed an unhandled error when I tried the following:
> 
> 1. emacs -Q
> 2. M-x browse-url-emacs RET http://hydra.gnu.org/build/12345
> 
> And the error is:
> 
>     find-file-noselect-1: Wrong type argument: arrayp, nil
> 
> As (file-truename buffer-file-name) fails when buffer-file-name is nil.
> 
> It would be good to have a more "friendly" error, like the one that
> (url-insert-file-contents "http://hydra.gnu.org/build/12345") produces.

browse-url-emacs is not supposed to display error messages for URLs
that don't exist or cannot be accessed.  That function is a fancy way
of visiting a "file buffer" with the HTML source of the URL, so it
should react like "C-x C-f" when the file does not exist.  "C-x C-f"
says "New file" and shows an empty buffer; browse-url-emacs's
equivalent is IMO a buffer with the error returned by the server, in
this case the standard 404 response.

So this is what I did in commit bcf4913 on the emacs-25 branch.  The
previous code in url-insert-file-contents signaled an error when it
received one of the 4xx responses, disregarding the VISIT argument,
which was a mistake (introduced when we fixed bug#16733, where VISIT
is nil).  Now it follows more closely the behavior of
insert-file-contents in that case.

Thanks.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 16 Jan 2016 12:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 9 years and 159 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.