@rsdk/core 1.0.8 → 1.0.9

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/CHANGELOG.md CHANGED
@@ -3,6 +3,10 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## 1.0.9 (2023-05-21)
7
+
8
+ **Note:** Version bump only for package @rsdk/core
9
+
6
10
  ## 1.0.8 (2023-05-17)
7
11
 
8
12
  **Note:** Version bump only for package @rsdk/core
@@ -7,6 +7,7 @@ import type { PlatformAppMetadata, PlatformAppOptions } from '../types';
7
7
  */
8
8
  export declare class PlatformApp {
9
9
  readonly platformAppOptions: PlatformAppOptions;
10
+ private static logger;
10
11
  private readonly context;
11
12
  constructor(platformAppOptions: PlatformAppOptions);
12
13
  /**
@@ -2,6 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PlatformApp = void 0;
4
4
  const core_1 = require("@nestjs/core");
5
+ const common_1 = require("@rsdk/common");
6
+ const logging_1 = require("@rsdk/logging");
5
7
  const platform_context_1 = require("../platform.context");
6
8
  /**
7
9
  * Platform application itself.
@@ -11,7 +13,29 @@ const platform_context_1 = require("../platform.context");
11
13
  */
12
14
  class PlatformApp {
13
15
  platformAppOptions;
16
+ static logger = logging_1.LoggerFactory.create(PlatformApp);
14
17
  context;
18
+ static {
19
+ const { logger } = PlatformApp;
20
+ logger.info('Registering unhandled rejections handler...');
21
+ // This code enriches output if unhandled exceptions happen
22
+ process.on('unhandledRejection', (reason, promise) => {
23
+ logger.error((0, common_1.text) `
24
+ Unhandled promise rejection happened! Process is shutting down
25
+ with exit code 1. See: https://github.com/nodejs/node/issues/20392
26
+ and https://nodejs.org/api/process.html#event-unhandledrejection
27
+ `, { promise, reason });
28
+ /**
29
+ * Additionally writes to standard console, because both <promise> and <reason>
30
+ * can be not serializable
31
+ */
32
+ console.error('Found unhandled rejection', {
33
+ promise,
34
+ reason,
35
+ });
36
+ process.exit(1);
37
+ });
38
+ }
15
39
  constructor(platformAppOptions) {
16
40
  this.platformAppOptions = platformAppOptions;
17
41
  this.context = new platform_context_1.PlatformContext(platformAppOptions);
@@ -1 +1 @@
1
- {"version":3,"file":"platform.app.js","sourceRoot":"","sources":["../../src/app/platform.app.ts"],"names":[],"mappings":";;;AACA,uCAA2C;AAE3C,0DAAsD;AAGtD;;;;;GAKG;AACH,MAAa,WAAW;IAGD;IAFJ,OAAO,CAAkB;IAE1C,YAAqB,kBAAsC;QAAtC,uBAAkB,GAAlB,kBAAkB,CAAoB;QACzD,IAAI,CAAC,OAAO,GAAG,IAAI,kCAAe,CAAC,kBAAkB,CAAC,CAAC;IACzD,CAAC;IAED;;;OAGG;IACH,WAAW;QACT,OAAO,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;IACpC,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,GAAG;QACP,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAC7B,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,iBAAiB,EAAE,CAAC;QAE3C,MAAM,OAAO,CAAC,wBAAwB,CAAC,GAAG,CAAC,CAAC;IAC9C,CAAC;IAED;;;;OAIG;IACK,KAAK,CAAC,iBAAiB;QAC7B,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAC7B,MAAM,WAAW,GAAG,OAAO,CAAC,2BAA2B,EAAE,CAAC;QAC1D,MAAM,GAAG,GAAG,MAAM,kBAAW,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,WAAW,CAAC,CAAC;QAEnE,MAAM,OAAO,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;QAChC,OAAO,GAAG,CAAC;IACb,CAAC;CACF;AAvCD,kCAuCC"}
1
+ {"version":3,"file":"platform.app.js","sourceRoot":"","sources":["../../src/app/platform.app.ts"],"names":[],"mappings":";;;AACA,uCAA2C;AA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