added Error method to print stack traces and exit