Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #5260
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!194.109.133.84.MISMATCH!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <ethan@stoneleaf.us> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.000 |
| X-Spam-Evidence | '*H*': 1.00; '*S*': 0.00; 'subject:module': 0.04; 'exception,': 0.07; ':-)': 0.07; 'attributes,': 0.09; 'exception.': 0.09; 'from:addr:ethan': 0.09; 'from:addr:stoneleaf.us': 0.09; 'from:name:ethan furman': 0.09; 'message-id:@stoneleaf.us': 0.09; 'override': 0.09; 'received:gator410.hostgator.com': 0.09; '~ethan~': 0.09; 'pm,': 0.11; 'exception': 0.12; 'wrote:': 0.14; '__init__': 0.16; 'mrab': 0.16; 'received:72.11': 0.16; 'received:72.11.125': 0.16; 'received:72.11.125.166': 0.16; 'cc:no real name:2**0': 0.20; 'cc:2**0': 0.20; 'header:In-Reply-To:1': 0.22; 'cc:addr:python- list': 0.22; 'etc,': 0.23; 'define': 0.26; 'raise': 0.29; 'class': 0.29; 'cc:addr:python.org': 0.31; "isn't": 0.34; 'header:User- Agent:1': 0.35; 'andrew': 0.38; 'to.': 0.39; 'need.': 0.39; 'how': 0.39; 'add': 0.39; 'header:Received:5': 0.40; 'skip:h 20': 0.60; 'received:hostgator.com': 0.64; 'received:websitewelcome.com': 0.71; 'received:gateway14.websitewelcome.com': 0.84; 'subject:handle': 0.84; 'received:69.93': 0.91 |
| Date | Thu, 12 May 2011 13:40:44 -0700 |
| From | Ethan Furman <ethan@stoneleaf.us> |
| User-Agent | Thunderbird 1.5.0.10 (Windows/20070221) |
| MIME-Version | 1.0 |
| To | Andrew Berg <bahamutzero8825@gmail.com> |
| Subject | Re: Proper way to handle errors in a module |
| References | <mailman.1415.1305134998.9059.python-list@python.org> <roy-FB35E1.14050911052011@news.panix.com> <4DCC318E.7020809@gmail.com> <4DCC3421.9070007@mrabarnett.plus.com> <4DCC3F37.3010904@gmail.com> |
| In-Reply-To | <4DCC3F37.3010904@gmail.com> |
| Content-Type | text/plain; charset=ISO-8859-1; format=flowed |
| Content-Transfer-Encoding | 7bit |
| X-AntiAbuse | This header was added to track abuse, please include it with any abuse report |
| X-AntiAbuse | Primary Hostname - gator410.hostgator.com |
| X-AntiAbuse | Original Domain - python.org |
| X-AntiAbuse | Originator/Caller UID/GID - [47 12] / [47 12] |
| X-AntiAbuse | Sender Address Domain - stoneleaf.us |
| X-Source | |
| X-Source-Args | |
| X-Source-Dir | |
| X-Source-Sender | mail.admailinc.com ([192.168.10.136]) [72.11.125.166]:3658 |
| Cc | python-list@python.org |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.12 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.1494.1305232074.9059.python-list@python.org> (permalink) |
| Lines | 14 |
| NNTP-Posting-Host | 82.94.164.166 |
| X-Trace | 1305232075 news.xs4all.nl 34849 [::ffff:82.94.164.166]:55672 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.python:5260 |
Show key headers only | View raw
Andrew Berg wrote:
> 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.
class HelloError(Exception):
"custom exception"
and that's all you need. You can override __init__ to add your own
attributes, etc, if you need to.
~Ethan~
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Proper way to handle errors in a module Andrew Berg <bahamutzero8825@gmail.com> - 2011-05-11 12:29 -0500
Re: Proper way to handle errors in a module Roy Smith <roy@panix.com> - 2011-05-11 14:05 -0400
Re: Proper way to handle errors in a module Andrew Berg <bahamutzero8825@gmail.com> - 2011-05-12 14:14 -0500
Re: Proper way to handle errors in a module MRAB <python@mrabarnett.plus.com> - 2011-05-12 20:25 +0100
Re: Proper way to handle errors in a module Andrew Berg <bahamutzero8825@gmail.com> - 2011-05-12 15:12 -0500
Re: Proper way to handle errors in a module Corey Richardson <kb1pkl@aim.com> - 2011-05-12 16:20 -0400
Re: Proper way to handle errors in a module Tycho Andersen <tycho@tycho.ws> - 2011-05-12 15:26 -0500
Re: Proper way to handle errors in a module Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-05-13 00:43 +0000
Re: Proper way to handle errors in a module MRAB <python@mrabarnett.plus.com> - 2011-05-12 21:26 +0100
Re: Proper way to handle errors in a module Ethan Furman <ethan@stoneleaf.us> - 2011-05-12 13:40 -0700
Re: Proper way to handle errors in a module Andrew Berg <bahamutzero8825@gmail.com> - 2011-05-12 15:35 -0500
Re: Proper way to handle errors in a module Ben Finney <ben+python@benfinney.id.au> - 2011-05-13 10:56 +1000
csiph-web