Skip to content

Commit

Permalink
fixed to catch errors when servient termination fails
Browse files Browse the repository at this point in the history
  • Loading branch information
hidetak committed Mar 4, 2024
1 parent 5d61095 commit 03546b7
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions node-red-node-wot/src/servients/servient-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,14 @@ export default class ServientManager {
}, 10000) // If it does not end after 10 seconds, it is considered to be finished.
try {
await servientWrapper.endServient()
console.debug("[debug] servient ended. id: " + id)
clearTimeout(timeoutId)
resolve()
} catch (err) {
console.debug("[debug] failed to end servient. id: " + id + " error: " + err.toString())
clearTimeout(timeoutId)
reject(err)
}
console.debug("[debug] servient ended. id: " + id)
clearTimeout(timeoutId)
resolve()
})
}

Expand Down

0 comments on commit 03546b7

Please sign in to comment.