[ create a new paste ] login | about

Link: http://codepad.org/gc1U5487    [ raw code | output | fork ]

Python, pasted on Jan 28:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import sys

def func1():
    func2()

def func2():
    raise Exception('test error')

def main():
    try:
        func1()
    except Exception, err:
        raise

if __name__ == '__main__':
    main()


Output:
1
2
3
4
5
6
7
8
9
10
Traceback (most recent call last):
  Line 16, in <module>
    main()
  Line 11, in main
    func1()
  Line 4, in func1
    func2()
  Line 7, in func2
    raise Exception('test error')
Exception: test error


Create a new paste based on this one


Comments: