Ben Cohen wrote:
Apologies for the TABs -- I wrote that example for demonstration purposes in my
mail client -- I'll copy and paste from a real code editor in the future.
Ben
There's nothing to apologies for. Be wary of those trying to get you out
of the right path, they will lie to you
I've condensed the advice from this thread into this.
import sys
import traceback
class ExceptionList(object):
def __init__(self, msg, errors=None, *args):
self.errortb = errors or []
super(ExceptionList, self).__init__(msg, *args)
def __str__(self):
Print a pretty
On Thu, 06 May 2010 21:56:10 -0700, Chris Rebert wrote:
[...]
Output from example:
Traceback (most recent call last):
File tmp.py, line 35, in module
multiple_err.do_raise()
File tmp.py, line 25, in do_raise
raise self
__main__.MultipleValidationErrors: See the following
In article mailman.2715.1273204222.23598.python-l...@python.org,
Ben Cohen nco...@ucsd.edu wrote:
eg -- I'd like to do something like this:
errors = []
for item in data:
try:
process(item)
except ValidationError as e:
errors.append(e)
raise
Many thanks for the excellent example!! You rock!
Ben
On May 6, 2010, at 10:56 PM, Chris Rebert wrote:
On Thu, May 6, 2010 at 8:50 PM, Ben Cohen nco...@ucsd.edu wrote:
Is there a pythonic way to collect and display multiple exceptions at the
same time?
For example let's say you're
On Fri, 07 May 2010 14:28:05 -0700, Aahz wrote:
In article mailman.2715.1273204222.23598.python-l...@python.org, Ben
Cohen nco...@ucsd.edu wrote:
eg -- I'd like to do something like this:
errors = []
for item in data:
try:
process(item)
except ValidationError as e:
On May 6, 2010, at 10:56 PM, Chris Rebert wrote:
On Thu, May 6, 2010 at 8:50 PM, Ben Cohen nco...@ucsd.edu wrote:
Is there a pythonic way to collect and display multiple exceptions at the
same time?
For example let's say you're trying to validate the elements of a list and
you'd like to
Apologies for the TABs -- I wrote that example for demonstration purposes in my
mail client -- I'll copy and paste from a real code editor in the future.
Ben
On May 7, 2010, at 3:28 PM, Aahz wrote:
In article mailman.2715.1273204222.23598.python-l...@python.org,
Ben Cohen nco...@ucsd.edu
Is there a pythonic way to collect and display multiple exceptions at the same
time?
For example let's say you're trying to validate the elements of a list and
you'd like to validate as many of the elements as possible in one run and still
report exception's raised while validating a failed
On Thu, May 6, 2010 at 8:50 PM, Ben Cohen nco...@ucsd.edu wrote:
Is there a pythonic way to collect and display multiple exceptions at the
same time?
For example let's say you're trying to validate the elements of a list and
you'd like to validate as many of the elements as possible in one
On 5/6/2010 11:50 PM, Ben Cohen wrote:
Is there a pythonic way to collect and display multiple exceptions at
the same time?
For example let's say you're trying to validate the elements of a
list and you'd like to validate as many of the elements as possible
in one run and still report
11 matches
Mail list logo