diff --git a/package.json b/package.json index 8a055ba26a1b5ab7c1ffe38fac9bf6212c2d449b..2952a2977580439e9500a3661b8819704c536ac6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "usp-js", - "version": "0.2.23", + "version": "0.2.24", "description": "Helper library for easy usp communication using mqtt over tcp or ws.", "main": "node/index.js", "browser": "web/index.js", diff --git a/src/configurations/build.ts b/src/configurations/build.ts index f225c76693496cb149837cdaa2556a7371502b90..83ce1b70ade6df5a4d516dba07ec78e58ec68777 100644 --- a/src/configurations/build.ts +++ b/src/configurations/build.ts @@ -108,14 +108,8 @@ const buildConnect: BuildConnectionFn = callbackRouter.add("error", handleError); - let client: any = null; const connectTimeout = options.connectTimeout || defaultConnectionTimeout; - - try { - client = await timeoutWrapper(async () => connectClient(options), connectTimeout); - } catch(err) { - throw new Error(`connection timed out(${connectTimeout}ms)`) - } + const client = await timeoutWrapper(async () => connectClient(options), connectTimeout); const handleInit = () => new Promise<string>((resolve, reject) => {