From f1d40b676ac31b48405397b793a6de1c004c3165 Mon Sep 17 00:00:00 2001
From: Marin Karamihalev <marin.karamihalev@iopsys.eu>
Date: Mon, 14 Mar 2022 15:05:17 +0100
Subject: [PATCH] minor fixes

---
 package.json                | 2 +-
 src/configurations/build.ts | 8 +-------
 2 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/package.json b/package.json
index 8a055ba..2952a29 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 f225c76..83ce1b7 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) => {
-- 
GitLab