log unhandled panic with stacktrace and return ErrorMsg with code 1