@resolveio/server-lib 5.1.0 → 5.1.1

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/server-app.js +9 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@resolveio/server-lib",
3
- "version": "5.1.0",
3
+ "version": "5.1.1",
4
4
  "description": "",
5
5
  "main": "index.ts",
6
6
  "scripts": {
package/server-app.js CHANGED
@@ -71,7 +71,6 @@ var ResolveIOMainServer = /** @class */ (function () {
71
71
  this._resolveioServer = mainServer;
72
72
  this._serverConfig = serverConfig;
73
73
  this._clientDir = clientDir;
74
- // process.on('unhandledException').
75
74
  // Start express app
76
75
  this._app = express();
77
76
  // Use body parser for http call (login)
@@ -348,6 +347,15 @@ var ResolveIOMainServer = /** @class */ (function () {
348
347
  // });
349
348
  // }
350
349
  // });
350
+ process.on('unhandledRejection', function (reason, p) {
351
+ console.error(reason, 'Unhandled Rejection at Promise', p);
352
+ _this._methodManager.sendEmail('dev@resolveio.com', 'SERVER - Unhandled Rejection - ' + _this._serverConfig['CLIENT_NAME'], JSON.stringify([reason, p]));
353
+ });
354
+ process.on('uncaughtException', function (err) {
355
+ console.error(err, 'Uncaught Exception thrown');
356
+ _this._methodManager.sendEmail('dev@resolveio.com', 'SERVER - Unhandled Exception - ' + _this._serverConfig['CLIENT_NAME'], JSON.stringify([err]));
357
+ process.exit(1);
358
+ });
351
359
  // Keep alive timer to ping/pong
352
360
  setInterval(function () {
353
361
  _this._wss.clients.forEach(function (ws) {