@@ -173,21 +173,21 @@ export class Channel extends EnhancedEventEmitter {
173173 }
174174 } ) ;
175175
176- this . #consumerSocket. on ( 'end' , ( ) =>
177- logger . debug ( 'Consumer Channel ended by the worker process' )
178- ) ;
176+ this . #consumerSocket. on ( 'end' , ( ) => {
177+ logger . debug ( 'Consumer Channel ended by the worker process' ) ;
178+ } ) ;
179179
180- this . #consumerSocket. on ( 'error' , error =>
181- logger . error ( `Consumer Channel error: ${ error } ` )
182- ) ;
180+ this . #consumerSocket. on ( 'error' , error => {
181+ logger . error ( `Consumer Channel error: ${ error } ` ) ;
182+ } ) ;
183183
184- this . #producerSocket. on ( 'end' , ( ) =>
185- logger . debug ( 'Producer Channel ended by the worker process' )
186- ) ;
184+ this . #producerSocket. on ( 'end' , ( ) => {
185+ logger . debug ( 'Producer Channel ended by the worker process' ) ;
186+ } ) ;
187187
188- this . #producerSocket. on ( 'error' , error =>
189- logger . error ( `Producer Channel error: ${ error } ` )
190- ) ;
188+ this . #producerSocket. on ( 'error' , error => {
189+ logger . error ( `Producer Channel error: ${ error } ` ) ;
190+ } ) ;
191191 }
192192
193193 /**
@@ -244,7 +244,7 @@ export class Channel extends EnhancedEventEmitter {
244244 ) ;
245245 }
246246
247- const handlerIdOffset = this . #bufferBuilder. createString ( handlerId ) ;
247+ const handlerIdOffset = this . #bufferBuilder. createString ( handlerId ?? '' ) ;
248248
249249 let notificationOffset : number ;
250250
@@ -283,14 +283,16 @@ export class Channel extends EnhancedEventEmitter {
283283 this . #bufferBuilder. clear ( ) ;
284284
285285 if ( buffer . byteLength > MESSAGE_MAX_LEN ) {
286- throw new Error ( `notification too big [event:${ Event [ event ] } ]` ) ;
286+ logger . error ( `notify() | notification too big [event:${ Event [ event ] } ]` ) ;
287+
288+ return ;
287289 }
288290
289291 try {
290292 // This may throw if closed or remote side ended.
291293 this . #producerSocket. write ( buffer , 'binary' ) ;
292294 } catch ( error ) {
293- logger . warn ( `notify() | sending notification failed: ${ error } ` ) ;
295+ logger . error ( `notify() | sending notification failed: ${ error } ` ) ;
294296
295297 return ;
296298 }
@@ -317,7 +319,6 @@ export class Channel extends EnhancedEventEmitter {
317319 }
318320
319321 const id = this . #nextId;
320-
321322 const handlerIdOffset = this . #bufferBuilder. createString ( handlerId ?? '' ) ;
322323
323324 let requestOffset : number ;
0 commit comments