From 81e5ba3a4215dbff67c9d1909b99ba7c87479a40 Mon Sep 17 00:00:00 2001 From: Thibaut Boustany Date: Tue, 31 Jul 2018 11:44:16 +0200 Subject: [PATCH] Fix double catch --- src/helpers/deviceAccess.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/helpers/deviceAccess.js b/src/helpers/deviceAccess.js index 9104b769..f6903462 100644 --- a/src/helpers/deviceAccess.js +++ b/src/helpers/deviceAccess.js @@ -40,7 +40,9 @@ export const withDevice: WithDevice = devicePath => job => { busy = true refreshBusyUIState() try { - const t = await retry(() => TransportNodeHid.open(devicePath), { maxRetry: 1 }).catch(mapError).catch(mapError) + const t = await retry(() => TransportNodeHid.open(devicePath), { maxRetry: 1 }).catch( + mapError, + ) t.setDebugMode(logger.apdu) try { const res = await job(t).catch(mapError)