On Mon, 15 Oct 2012 09:00:15 -0700, Wanderer wrote:
> How do you get Exceptions to print messages? I have an exception defined
> like this
>
> class PvCamError(Exception):
> def __init__(self, msg):
> self.msg = msg
Please don't invent yet another interface for exception messages.
E
On 10/15/2012 12:22 PM, John Gordon wrote:
In MRAB
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 i
On Monday, October 15, 2012 1:34:24 PM UTC-4, MRAB wrote:
> On 2012-10-15 18:18, Wanderer wrote:
>
> > On Monday, October 15, 2012 12:34:53 PM UTC-4, MRAB wrote:
>
> >
>
> >>
>
> >> Yes, but you've put the message in msg, and Exception doesn't have that
>
> >>
>
> >> attribute.
>
> >>
>
> >
On 2012-10-15 18:18, Wanderer wrote:
On Monday, October 15, 2012 12:34:53 PM UTC-4, MRAB wrote:
Yes, but you've put the message in msg, and Exception doesn't have that
attribute.
That's weird. I got this Exception class definition idea from this post by
Guido van Rostrum, Where he gives t
On Monday, October 15, 2012 1:18:52 PM UTC-4, Wanderer wrote:
> On Monday, October 15, 2012 12:34:53 PM UTC-4, MRAB wrote:
>
>
>
> >
>
> > Yes, but you've put the message in msg, and Exception doesn't have that
>
> >
>
> > attribute.
>
> >
>
>
>
> That's weird. I got this Exception cla
On Monday, October 15, 2012 12:34:53 PM UTC-4, MRAB wrote:
>
> Yes, but you've put the message in msg, and Exception doesn't have that
>
> attribute.
>
That's weird. I got this Exception class definition idea from this post by
Guido van Rostrum, Where he gives this main function to look like
On 10/15/2012 12:34 PM, MRAB wrote:
> On 2012-10-15 17:22, John Gordon wrote:
>> In MRAB
>> 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
On 2012-10-15 17:22, John Gordon wrote:
In MRAB
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
In MRAB
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?
--
On 2012-10-15 17:00, Wanderer wrote:
How do you get Exceptions to print messages? I have an exception defined like
this
class PvCamError(Exception):
def __init__(self, msg):
self.msg = msg
But when the error is raised I get this:
Traceback (most recent call last):
File
"C:\P
10 matches
Mail list logo