print stacktrace and exit when error occur