Skip to content

Commit

Permalink
Improve error message (#205)
Browse files Browse the repository at this point in the history
  • Loading branch information
freiondrej-lokalise authored Sep 10, 2024
1 parent e733ec2 commit 1e6bcf1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/core/lib/queues/AbstractPublisherManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,9 @@ export abstract class AbstractPublisherManager<
): Promise<MessageSchemaType<SupportedEventDefinitions[number]>> {
const publisher = this.targetToPublisherMap[eventTarget]
if (!publisher) {
throw new Error(`No publisher for target ${eventTarget}`)
throw new Error(
`No publisher for target ${eventTarget} - did you perhaps forget to update supportedEvents passed to EventRegistry?`,
)
}
const messageDefinition = this.resolveMessageDefinition(eventTarget, message)
if (!messageDefinition) {
Expand Down Expand Up @@ -254,7 +256,9 @@ export abstract class AbstractPublisherManager<
const publisher = this.targetToPublisherMap[eventTarget]

if (!publisher) {
throw new Error(`No publisher for target ${eventTarget}`)
throw new Error(
`No publisher for target ${eventTarget} - did you perhaps forget to update supportedEvents passed to EventRegistry?`,
)
}

return publisher.handlerSpy
Expand Down

0 comments on commit 1e6bcf1

Please sign in to comment.