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


Groups > comp.lang.python > #79953 > unrolled thread

When using a decorator exceptions raised reference the decorator not the function

Started byNéstor Boscán <nestorjb@gmail.com>
First post2014-10-30 08:03 -0430
Last post2014-10-30 08:03 -0430
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python


Contents

  When using a decorator exceptions raised reference the decorator not the function Néstor Boscán <nestorjb@gmail.com> - 2014-10-30 08:03 -0430

#79953 — When using a decorator exceptions raised reference the decorator not the function

FromNéstor Boscán <nestorjb@gmail.com>
Date2014-10-30 08:03 -0430
SubjectWhen using a decorator exceptions raised reference the decorator not the function
Message-ID<mailman.15320.1414672561.18130.python-list@python.org>

[Multipart message — attachments visible in raw view] — view raw

Hi

I'm using Python 2.7 and I'm creating a class decorator that extract
information from exceptions for logging purposes.

Everytime an exception is raised from the original function and I extract
the origin of the exception with sys.exc_info() I get a reference to the
line in the decorator where the function is called, not the line of the
original function where the exception was raised.

Any ideas?

Regards,

Néstor

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web