From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: John Mastro Newsgroups: gmane.emacs.help Subject: Re: correct way to anticipate decryption failures Date: Tue, 15 Sep 2015 16:01:33 -0700 Message-ID: References: <87y4g78fkh.fsf@gmx.us> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1442358131 11675 80.91.229.3 (15 Sep 2015 23:02:11 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 15 Sep 2015 23:02:11 +0000 (UTC) To: "help-gnu-emacs@gnu.org" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Sep 16 01:02:07 2015 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 1ZbzEk-0005G1-Ne for geh-help-gnu-emacs@m.gmane.org; Wed, 16 Sep 2015 01:02:06 +0200 Original-Received: from localhost ([::1]:46303 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZbzEj-0004Nx-Ts for geh-help-gnu-emacs@m.gmane.org; Tue, 15 Sep 2015 19:02:05 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48961) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZbzEa-0004NU-5v for help-gnu-emacs@gnu.org; Tue, 15 Sep 2015 19:01:56 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZbzEZ-0004O7-6Y for help-gnu-emacs@gnu.org; Tue, 15 Sep 2015 19:01:56 -0400 Original-Received: from mail-ob0-x229.google.com ([2607:f8b0:4003:c01::229]:33524) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZbzEZ-0004O0-05 for help-gnu-emacs@gnu.org; Tue, 15 Sep 2015 19:01:55 -0400 Original-Received: by obbbh8 with SMTP id bh8so148193205obb.0 for ; Tue, 15 Sep 2015 16:01:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=uTzIce1LeixKZHWsaYewHNgHgFqXzVKh1OCQulRuCno=; b=Nwes/NzahZcwmxFOwrzEmn/oD1hd4ySneZhyvgc+l9LSXS642aI7YTTTSIgomOjPSZ QocaNcPEL+xJUgYedQ6mVO5FzmCphRsZaUlk2SJ0s8bB2bfF7pGlysqMbpnsmDznKm2K gWKrGnkEkg50KASzM4PflaCqBHUTvSjsidCUfNRw7e9QOwzkAwkUp6lWycjVco2I6PzD RAAgs5dkSvXbXA1POcPhya/BuueFD8xinj7PwwRcyZKR/w5zgbFp1IPM1QN+xKU/EYgm edBMcn8q7GRMysn/Pqi1v4D/h5D8/v7hQSGv8kjm6KSfmHvLsAhsStHG/ylHUsUt7fLQ /Kvw== X-Received: by 10.60.142.72 with SMTP id ru8mr20687117oeb.63.1442358113190; Tue, 15 Sep 2015 16:01:53 -0700 (PDT) Original-Received: by 10.76.45.8 with HTTP; Tue, 15 Sep 2015 16:01:33 -0700 (PDT) In-Reply-To: <87y4g78fkh.fsf@gmx.us> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4003:c01::229 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:107219 Archived-At: Rasmus wrote: > What is the correct way to handle decryption errors when using > auth-source? I have something like, > > (auth-source-search :host "worldwide.net" > :user "rasmus" > :max 1 :require '(:user :secret)) > > This throws a decryption error when I haven't plugged in my (physical) > security token. > > Depending on the arguments, sometimes this is called at init time causing > my daemon window to vanish, which is sort of annoying. > > Should I ignore-errors or is there a better way to test if I'm currently > able to decrypt .authinfo.gpg? Could I re-throw the warning without it > being an error? You can probably use `with-demoted-errors'. Something like: (with-demoted-errors "Auth source error: %s" (auth-source-search :host "worldwide.net" :user "rasmus" :max 1 :require '(:user :secret))) It catches the error and simply prints the message. -- john