@@ -572,11 +572,11 @@ export default class ExposedThing extends TD.Thing implements WoT.ExposedThing {
572572 *
573573 * @experimental
574574 */
575- public async handleUnsubscribeEvent (
575+ public handleUnsubscribeEvent (
576576 name : string ,
577577 listener : ContentListener ,
578578 options : WoT . InteractionOptions & { formIndex : number }
579- ) : Promise < void > {
579+ ) : void {
580580 if ( this . events [ name ] != null ) {
581581 Helpers . validateInteractionOptions ( this , this . events [ name ] , options ) ;
582582
@@ -595,7 +595,9 @@ export default class ExposedThing extends TD.Thing implements WoT.ExposedThing {
595595 }
596596 const unsubscribe = this . #eventHandlers. get ( name ) ?. unsubscribe ;
597597 if ( unsubscribe ) {
598- await unsubscribe ( options ) ;
598+ unsubscribe ( options ) . catch ( ( error ) => {
599+ throw error ;
600+ } ) ;
599601 }
600602 debug ( `ExposedThing '${ this . title } ' unsubscribes from event '${ name } '` ) ;
601603 } else {
@@ -639,11 +641,11 @@ export default class ExposedThing extends TD.Thing implements WoT.ExposedThing {
639641 }
640642 }
641643
642- public async handleUnobserveProperty (
644+ public handleUnobserveProperty (
643645 name : string ,
644646 listener : ContentListener ,
645647 options : WoT . InteractionOptions & { formIndex : number }
646- ) : Promise < void > {
648+ ) : void {
647649 if ( this . properties [ name ] != null ) {
648650 Helpers . validateInteractionOptions ( this , this . properties [ name ] , options ) ;
649651 const formIndex = ProtocolHelpers . getFormIndexForOperation (
@@ -663,7 +665,9 @@ export default class ExposedThing extends TD.Thing implements WoT.ExposedThing {
663665
664666 const unobserveHandler = this . #propertyHandlers. get ( name ) ?. unobserveHandler ;
665667 if ( unobserveHandler ) {
666- await unobserveHandler ( options ) ;
668+ unobserveHandler ( options ) . catch ( ( error ) => {
669+ throw error ;
670+ } ) ;
667671 }
668672 } else {
669673 throw new Error ( `ExposedThing '${ this . title } ', no property found for '${ name } '` ) ;
0 commit comments