Skip to content

Commit 0eaa9d4

Browse files
feat: lift exceptions
1 parent 2f3f071 commit 0eaa9d4

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@nestjstools/messaging",
3-
"version": "3.0.2",
3+
"version": "3.1.0",
44
"description": "Simplifies asynchronous and synchronous message handling with support for buses, handlers, channels, and consumers. Build scalable, decoupled applications with ease and reliability.",
55
"author": "Sebastian Iwanczyszyn",
66
"license": "MIT",
@@ -43,8 +43,6 @@
4343
"lint": "node_modules/.bin/eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
4444
"test": "npm run test:e2e && npm run test:unit",
4545
"test:watch": "node_modules/.bin/jest --watch",
46-
"test:unit:watch": "node_modules/.bin/jest --watch --config ./test/jest-unit.json",
47-
"test:cov": "node_modules/.bin/jest --coverage",
4846
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
4947
"test:e2e": "node_modules/.bin/jest --config ./test/jest-e2e.json",
5048
"test:unit": "node_modules/.bin/jest --config ./test/jest-unit.json"

src/messaging.module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ export class MessagingModule
240240
private readonly discoveryService: DiscoveryService,
241241
) {}
242242

243-
onApplicationBootstrap(): any {
243+
onApplicationBootstrap(): void {
244244
registerHandlers(this.moduleRef, this.discoveryService);
245245
registerMiddlewares(this.moduleRef, this.discoveryService);
246246
registerMessageNormalizers(this.moduleRef, this.discoveryService);

src/normalizer/object-forward-message.normalizer.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { MessageNormalizer } from './message-normalizer';
22
import { MessagingNormalizer } from '../dependency-injection/decorator';
3+
import { MessagingException } from '../exception/messaging.exception';
34

45
@MessagingNormalizer()
56
export class ObjectForwardMessageNormalizer implements MessageNormalizer {
@@ -9,7 +10,7 @@ export class ObjectForwardMessageNormalizer implements MessageNormalizer {
910

1011
async denormalize(message: string | object, type: string): Promise<object> {
1112
if (typeof message !== 'object') {
12-
throw new Error('Unable to denormalize object');
13+
throw new MessagingException('Unable to denormalize object');
1314
}
1415

1516
return message;

0 commit comments

Comments
 (0)