@@ -3,10 +3,10 @@ import { CommandKit } from '../../CommandKit';
33import { ListenerFunction } from '../../events/CommandKitEventsChannel' ;
44import { Logger } from '../../logger/Logger' ;
55import { toFileURL } from '../../utils/resolve-file-url' ;
6- import { StopEventPropagationError } from '../../utils/utilities' ;
76import { runInEventWorkerContext } from '../events/EventWorkerContext' ;
87import { ParsedEvent } from '../router' ;
98import { CommandKitEventDispatch } from '../../plugins' ;
9+ import { CommandKitErrorCodes , isErrorType } from '../../utils/error-codes' ;
1010
1111/**
1212 * Represents an event listener with its configuration.
@@ -207,7 +207,7 @@ export class AppEventsHandler {
207207 await listener . handler ( ...args ) ;
208208 } catch ( e ) {
209209 // Check if this is a stop propagation signal
210- if ( e instanceof StopEventPropagationError ) {
210+ if ( isErrorType ( e , CommandKitErrorCodes . StopEvents ) ) {
211211 Logger . debug (
212212 `Event propagation stopped for ${ name } ${
213213 namespace ? ` of namespace ${ namespace } ` : ''
@@ -274,7 +274,7 @@ export class AppEventsHandler {
274274 executedOnceListeners . add ( listener . handler ) ;
275275 } catch ( e ) {
276276 // Check if this is a stop propagation signal
277- if ( e instanceof StopEventPropagationError ) {
277+ if ( isErrorType ( e , CommandKitErrorCodes . StopEvents ) ) {
278278 Logger . debug (
279279 `Event propagation stopped for ${ name } ${
280280 namespace ? ` of namespace ${ namespace } ` : ''
0 commit comments