Skip to content

Commit

Permalink
Improve error message
Browse files Browse the repository at this point in the history
I got stuck with this for some time, hopefully this might help someone avoid the same problem.
  • Loading branch information
freiondrej-lokalise authored Sep 6, 2024
1 parent fc172df commit 19605d7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/core/lib/queues/AbstractPublisherManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ 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 +254,7 @@ 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 19605d7

Please sign in to comment.