diff --git a/packages/processors/src/exceptions/unsupportedEvent.exception.ts b/packages/processors/src/exceptions/unsupportedEvent.exception.ts index 4760f12..07533f8 100644 --- a/packages/processors/src/exceptions/unsupportedEvent.exception.ts +++ b/packages/processors/src/exceptions/unsupportedEvent.exception.ts @@ -4,7 +4,10 @@ export class UnsupportedEventException extends Error { constructor( contract: ContractName, public readonly eventName: string, + strategyName?: string, ) { - super(`Event ${eventName} unsupported for ${contract} processor`); + super( + `Event ${eventName} unsupported for ${contract} processor${strategyName ? `, strategy ${strategyName}` : ""}`, + ); } } diff --git a/packages/processors/src/processors/strategy/directAllocation/directAllocation.handler.ts b/packages/processors/src/processors/strategy/directAllocation/directAllocation.handler.ts index 4b8396d..1c48c2b 100644 --- a/packages/processors/src/processors/strategy/directAllocation/directAllocation.handler.ts +++ b/packages/processors/src/processors/strategy/directAllocation/directAllocation.handler.ts @@ -32,7 +32,7 @@ export class DirectAllocationStrategyHandler extends BaseStrategyHandler { this.dependencies, ).handle(); default: - throw new UnsupportedEventException("Strategy", event.eventName); + throw new UnsupportedEventException("Strategy", event.eventName, this.name); } } } diff --git a/packages/processors/src/processors/strategy/donationVotingMerkleDistributionDirectTransfer/dvmdDirectTransfer.handler.ts b/packages/processors/src/processors/strategy/donationVotingMerkleDistributionDirectTransfer/dvmdDirectTransfer.handler.ts index d480ead..c998e26 100644 --- a/packages/processors/src/processors/strategy/donationVotingMerkleDistributionDirectTransfer/dvmdDirectTransfer.handler.ts +++ b/packages/processors/src/processors/strategy/donationVotingMerkleDistributionDirectTransfer/dvmdDirectTransfer.handler.ts @@ -112,7 +112,7 @@ export class DVMDDirectTransferStrategyHandler extends BaseStrategyHandler { this.dependencies, ).handle(); default: - throw new UnsupportedEventException("Strategy", event.eventName); + throw new UnsupportedEventException("Strategy", event.eventName, this.name); } } diff --git a/packages/processors/test/strategy/directAllocation/directAllocation.handler.spec.ts b/packages/processors/test/strategy/directAllocation/directAllocation.handler.spec.ts index 02486b2..193c8b8 100644 --- a/packages/processors/test/strategy/directAllocation/directAllocation.handler.spec.ts +++ b/packages/processors/test/strategy/directAllocation/directAllocation.handler.spec.ts @@ -89,6 +89,8 @@ describe("DirectAllocationStrategyHandler", () => { eventName: "UnknownEvent", } as unknown as ProcessorEvent<"Strategy", StrategyEvent>; - await expect(handler.handle(mockEvent)).rejects.toThrow(UnsupportedEventException); + await expect(handler.handle(mockEvent)).rejects.toThrow( + new UnsupportedEventException("Strategy", "UnknownEvent", handler.name), + ); }); }); diff --git a/packages/processors/test/strategy/donationVotingMerkleDistributionDirectTransfer/dvmdDirectTransfer.handler.spec.ts b/packages/processors/test/strategy/donationVotingMerkleDistributionDirectTransfer/dvmdDirectTransfer.handler.spec.ts index ded3141..171de57 100644 --- a/packages/processors/test/strategy/donationVotingMerkleDistributionDirectTransfer/dvmdDirectTransfer.handler.spec.ts +++ b/packages/processors/test/strategy/donationVotingMerkleDistributionDirectTransfer/dvmdDirectTransfer.handler.spec.ts @@ -407,6 +407,8 @@ describe("DVMDDirectTransferHandler", () => { "Strategy", StrategyEvent >; - await expect(() => handler.handle(mockEvent)).rejects.toThrow(UnsupportedEventException); + await expect(() => handler.handle(mockEvent)).rejects.toThrow( + new UnsupportedEventException("Strategy", "UnknownEvent", handler.name), + ); }); });