From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Martin Newsgroups: gmane.emacs.help Subject: url-retrieve - how to access status Date: Mon, 17 Mar 2014 07:56:49 +0100 Message-ID: <87bnx5l3da.fsf@gmx.at> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1395039524 27029 80.91.229.3 (17 Mar 2014 06:58:44 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 17 Mar 2014 06:58:44 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Mar 17 07:58:54 2014 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WPRVd-0007Q9-GP for geh-help-gnu-emacs@m.gmane.org; Mon, 17 Mar 2014 07:58:53 +0100 Original-Received: from localhost ([::1]:55918 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WPRVd-0000z3-7R for geh-help-gnu-emacs@m.gmane.org; Mon, 17 Mar 2014 02:58:53 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47220) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WPRTq-0006qx-Ip for help-gnu-emacs@gnu.org; Mon, 17 Mar 2014 02:57:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WPRTg-000518-1m for help-gnu-emacs@gnu.org; Mon, 17 Mar 2014 02:57:02 -0400 Original-Received: from mout.gmx.net ([212.227.17.20]:58010) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WPRTf-000513-OR for help-gnu-emacs@gnu.org; Mon, 17 Mar 2014 02:56:51 -0400 Original-Received: from martin-desktop ([80.121.11.31]) by mail.gmx.com (mrgmx103) with ESMTPSA (Nemesis) id 0LbMb0-1WrNdI17Eo-00kyo9 for ; Mon, 17 Mar 2014 07:56:50 +0100 User-agent: mu4e 0.9.9.5; emacs 24.3.1 X-Provags-ID: V03:K0:saDybBICwkcnQ/fOaE+cOzzi+hSaCsWgoeZrNd2rtX0ek7VWiiO 6mMjknqE0zvYMGYTgeGU7PIjUCBlluo1O9sxhMJe2lqlA7N07pb5PUblWhDOsSxr6vseB04 SuUT2nFg6DC4E2w6YYcH6bqQcQIg+1WcOyptl6vFcy38Be2nIZi4lwEf7JtmfSJEo97Yeby cp/nX9ItEt2EagFnvSbaw== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 212.227.17.20 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:96549 Archived-At: Hi there. This time I come with a minimal example. The info page says: | STATUS is a plist representing what happened during the request, | with most recent events first, or an empty list if no events have | occurred. Each pair is one of: | | (:redirect REDIRECTED-TO) - the request was redirected to this URL | (:error (ERROR-SYMBOL . DATA)) - an error occurred. The error can be | signaled with (signal ERROR-SYMBOL DATA). But I'm not able to handle that, about 2 hours didn't help me to find the solution: Doing: (require 'url) (defun my-callback (status) "docstring" ;; what has to be here if I want to know why my buffer is empty. ;; specialy I want to handle the status for its :error - but I don't ;; know why. (prin1 status) (switch-to-buffer (current-buffer))) (url-retrieve "http://0.0.0.0:3000" 'my-callback) where 0.0.0.0:3000 works if my ruby on rails server is started, but if not i get on the prin1 line: (:error (error connection-failed "failed with code 111 " :host "0.0.0.0" :service 3000)) but how can I make a good message to the minibuffer so the user knows the server is not reachable or something, and second, how do I have to set up conditional parameters, not to switch to the buffer or something. That would be easy for you, but I didn't figure it out and want to learn from you. Thanks for your help, Martin