hola-server 0.7.2 → 0.7.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/http/error.js +4 -1
- package/package.json +1 -1
package/http/error.js
CHANGED
|
@@ -6,7 +6,10 @@ const wrap_http = fn => (...args) => fn(...args).catch(args[2]);
|
|
|
6
6
|
const handle_exception = app => {
|
|
7
7
|
app.use(function (error, req, res, next) {
|
|
8
8
|
if (is_log_error()) {
|
|
9
|
-
|
|
9
|
+
if (error) {
|
|
10
|
+
const error_msg = error.stack ? error.stack : JSON.stringify(error);
|
|
11
|
+
log_error(LOG_SYSTEM, error_msg);
|
|
12
|
+
}
|
|
10
13
|
} else {
|
|
11
14
|
throw new Error(error);
|
|
12
15
|
}
|