Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #31318

Re: Exception Messages

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!news-out.readnews.com!transit4.readnews.com!panix!gordon
From John Gordon <gordon@panix.com>
Newsgroups comp.lang.python
Subject Re: Exception Messages
Date Mon, 15 Oct 2012 16:22:04 +0000 (UTC)
Organization PANIX Public Access Internet and UNIX, NYC
Lines 19
Message-ID <k5hd7c$emf$1@reader1.panix.com> (permalink)
References <8b5cb95f-424b-45a8-b19b-42f92f531a75@googlegroups.com> <mailman.2217.1350317845.27098.python-list@python.org>
NNTP-Posting-Host panix3.panix.com
X-Trace reader1.panix.com 1350318124 15055 166.84.1.3 (15 Oct 2012 16:22:04 GMT)
X-Complaints-To abuse@panix.com
NNTP-Posting-Date Mon, 15 Oct 2012 16:22:04 +0000 (UTC)
User-Agent nn/6.7.3
Xref csiph.com comp.lang.python:31318

Show key headers only | View raw


In <mailman.2217.1350317845.27098.python-list@python.org> MRAB <python@mrabarnett.plus.com> writes:

> > Why wasn't the message printed out?
>
> You didn't add a __str__ method:

> class PvCamError(Exception):
>      def __init__(self, msg):
>          self.msg = msg
>      def __str__(self):
>          return self.msg

Wouldn't PvCamError inherit __str__() from Exception?

-- 
John Gordon                   A is for Amy, who fell down the stairs
gordon@panix.com              B is for Basil, assaulted by bears
                                -- Edward Gorey, "The Gashlycrumb Tinies"

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Exception Messages Wanderer <wanderer@dialup4less.com> - 2012-10-15 09:00 -0700
  Re: Exception Messages MRAB <python@mrabarnett.plus.com> - 2012-10-15 17:17 +0100
    Re: Exception Messages John Gordon <gordon@panix.com> - 2012-10-15 16:22 +0000
      Re: Exception Messages MRAB <python@mrabarnett.plus.com> - 2012-10-15 17:34 +0100
        Re: Exception Messages Wanderer <wanderer@dialup4less.com> - 2012-10-15 10:18 -0700
          Re: Exception Messages Wanderer <wanderer@dialup4less.com> - 2012-10-15 10:20 -0700
          Re: Exception Messages Wanderer <wanderer@dialup4less.com> - 2012-10-15 10:20 -0700
          Re: Exception Messages MRAB <python@mrabarnett.plus.com> - 2012-10-15 18:34 +0100
            Re: Exception Messages Wanderer <wanderer@dialup4less.com> - 2012-10-15 10:44 -0700
            Re: Exception Messages Wanderer <wanderer@dialup4less.com> - 2012-10-15 10:44 -0700
        Re: Exception Messages Wanderer <wanderer@dialup4less.com> - 2012-10-15 10:18 -0700
      Re: Exception Messages Dave Angel <d@davea.name> - 2012-10-15 12:42 -0400
      Re: Exception Messages Terry Reedy <tjreedy@udel.edu> - 2012-10-15 15:15 -0400
  Re: Exception Messages Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-10-16 00:47 +0000

csiph-web