0

Is there any way, how to find out line of code, where I called: raise MyError("something")??

I have code like this:

class MyError(Exception):
    def __init__(self, value):
        self.value = value

    def __str__(self):
        return repr(self.value)

Can I get the line of exception in this class?

Calling like this:

try:
    somethin()
except:
    raise MyError("abc")

Thank you

4

1 回答 1

1

您应该能够为此使用回溯

于 2012-04-25T22:19:59.360 回答