Skip to content

Commit

Permalink
fix: exception when no message handler is registered. (#64)
Browse files Browse the repository at this point in the history
When no metadata is found for a handler, it should return early from the setup, rather than warning and attempting to continue, which immediately causes errors.
  • Loading branch information
workmad3 authored Aug 24, 2023
1 parent 5e44645 commit a3d0ff9
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/sqs.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export class SqsService implements OnModuleInit, OnModuleDestroy {
const metadata = messageHandlers.find(({ meta }) => meta.name === name);
if (!metadata) {
this.logger.warn(`No metadata found for: ${name}`);
return;
}

const isBatchHandler = metadata.meta.batch === true;
Expand Down

0 comments on commit a3d0ff9

Please sign in to comment.