@rayondigital/nest-dapr 0.9.55 → 0.9.57

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.
@@ -6,6 +6,7 @@ export declare class NestActorManager {
6
6
  setup(moduleRef: ModuleRef, options: DaprModuleOptions, onActivateFn?: (actorId: ActorId, instance: AbstractActor) => Promise<void>): void;
7
7
  setupReentrancy(options: DaprModuleOptions): void;
8
8
  setupCSLWrapper(options: DaprModuleOptions, contextService: DaprContextService, invokeWrapperFn?: (actorId: ActorId, methodName: string, data: any, method: (actorId: ActorId, methodName: string, data: any) => Promise<any>) => Promise<any>): void;
9
+ private catchAndLogUnhandledExceptions;
9
10
  private patchToSupportSerializableError;
10
11
  private patchDeactivate;
11
12
  private resolveDependencies;
@@ -65,6 +65,9 @@ let NestActorManager = NestActorManager_1 = class NestActorManager {
65
65
  };
66
66
  this.patchDeactivate(options);
67
67
  this.patchToSupportSerializableError(options);
68
+ if (isLoggingEnabled) {
69
+ this.catchAndLogUnhandledExceptions();
70
+ }
68
71
  }
69
72
  setupReentrancy(options) {
70
73
  ActorClientHTTP_1.default.prototype.invoke = function (actorType, actorId, methodName, body, reentrancyId) {
@@ -74,7 +77,7 @@ let NestActorManager = NestActorManager_1 = class NestActorManager {
74
77
  method: 'POST',
75
78
  body,
76
79
  headers: {
77
- 'Dapr-Reentrancy-Id': reentrancyId,
80
+ 'Dapr-Reentrancy-Id': reentrancyId !== null && reentrancyId !== void 0 ? reentrancyId : (0, crypto_1.randomUUID)(),
78
81
  },
79
82
  });
80
83
  return result;
@@ -136,6 +139,14 @@ let NestActorManager = NestActorManager_1 = class NestActorManager {
136
139
  });
137
140
  };
138
141
  }
142
+ catchAndLogUnhandledExceptions() {
143
+ process.on('uncaughtException', (err) => {
144
+ console.error('Unhandled Exception:', err);
145
+ });
146
+ process.on('unhandledRejection', (reason, promise) => {
147
+ console.error('Unhandled Rejection at:', promise, 'reason:', reason);
148
+ });
149
+ }
139
150
  patchToSupportSerializableError(options) {
140
151
  const originalHandlerMethod = actor_1.default.prototype.handlerMethod;
141
152
  if (!originalHandlerMethod)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rayondigital/nest-dapr",
3
- "version": "0.9.55",
3
+ "version": "0.9.57",
4
4
  "description": "Develop NestJs microservices using Dapr pubsub, actors and other bindings",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",