fixed error reraising

In the old code the eception trace was not printed.
Now it reraises the exception correctly.