Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!xlned.com!feeder5.xlned.com!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.006 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'subject:module': 0.04; 'exception,': 0.07; ':-)': 0.07; 'exception.': 0.09; 'pm,': 0.11; 'exception': 0.12; 'wrote:': 0.14; 'mrab': 0.16; 'received:192.168.1.6': 0.16; 'header:In-Reply-To:1': 0.22; 'received:209.85.214.174': 0.23; 'received:mail- iw0-f174.google.com': 0.23; 'define': 0.26; 'raise': 0.29; 'message-id:@gmail.com': 0.30; 'to:addr:python-list': 0.32; "isn't": 0.34; 'received:192.168.1': 0.34; 'received:192': 0.34; 'header:User-Agent:1': 0.35; 'received:192.168': 0.37; 'received:209.85': 0.37; 'received:google.com': 0.38; 'received:209.85.214': 0.39; 'to:addr:python.org': 0.39; 'received:209': 0.39; 'how': 0.39; 'header:Received:5': 0.40; 'subject:handle': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; bh=ppUY0KuG8YfKGgKctTf7N6/t5pqlW+MrTEWhO6TBRY8=; b=tHLHDAnApf9zqv1t3JiZiQumvPUMxX/07roMWluMXVyiuWFHRQ9K8NUKT9Jnql/HXh vh0MoXIywcBOLrgmLYR7TAAC4KTX/MEVhoCM/hTF5JgxeM0MlCDL7K0mkDUXE/ys/NTS 7OyQ67mEg4tgnxcOEZINDtVG4EUQMYzEIPve8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=ASoTZANzlnuRtkEpKwVWGv9IFB2cnLoAHVtB51/LHg9h0VAdrVttRJNtHea39EtjrL IOT8LxWcBfjDtC3XdJpZCAQWGbD5iiyb/mu+XXghlKqkHT4KiJzczG6MRpFTcDYRTNp9 r4Jqz4CiYhns5/4S9pxXMh83QuLdXMAaoDmFA= Date: Thu, 12 May 2011 15:12:39 -0500 From: Andrew Berg User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.15) Gecko/20110303 Thunderbird/3.1.9 ThunderBrowse/3.3.5 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Proper way to handle errors in a module References: <4DCC318E.7020809@gmail.com> <4DCC3421.9070007@mrabarnett.plus.com> In-Reply-To: <4DCC3421.9070007@mrabarnett.plus.com> X-Enigmail-Version: 1.1.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 5 NNTP-Posting-Host: 82.94.164.166 X-Trace: 1305231165 news.xs4all.nl 41103 [::ffff:82.94.164.166]:58842 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:5255 On 2011.05.12 02:25 PM, MRAB wrote: > You can raise an exception wherever you like! :-) If I raise an exception that isn't a built-in exception, I get something like "NameError: name 'HelloError' is not defined". I don't know how to define the exception.