diff --git a/node-red-node-wot/src/servients/servient-manager.ts b/node-red-node-wot/src/servients/servient-manager.ts index 3c82061..99756ee 100644 --- a/node-red-node-wot/src/servients/servient-manager.ts +++ b/node-red-node-wot/src/servients/servient-manager.ts @@ -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() }) }