Catch errors printing stacktrace