From fdf3c3bf641fe670cf6c6e5b43624dc829d9aefa Mon Sep 17 00:00:00 2001 From: cheetah Date: Fri, 2 Apr 2021 16:28:30 +0000 Subject: [PATCH] disabled Connectors now fail in a known way instead of breaking DeliveryChain --- types/ConnectorRegistry.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/types/ConnectorRegistry.js b/types/ConnectorRegistry.js index 8e0e582..152206f 100644 --- a/types/ConnectorRegistry.js +++ b/types/ConnectorRegistry.js @@ -14,7 +14,10 @@ class ConnectorRegistry { connector.Hook(this) } transmit(name, msg, params) { - if (!this.Connectors[ name ]) throw "not registred" + if (!this.Connectors[ name ]) { + setTimeout(this.reportFail.bind(this), 1e3, msg, name) + return false + } //md5(JSON.stringify([name, ...params])), this.Connectors[ name ].transmitMessage(msg, params) }