diff --git a/ironfish-cli/src/ledger/ledger.ts b/ironfish-cli/src/ledger/ledger.ts index d4538c7003..bedc78e5bb 100644 --- a/ironfish-cli/src/ledger/ledger.ts +++ b/ironfish-cli/src/ledger/ledger.ts @@ -2,7 +2,11 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ import { Assert } from '@ironfish/sdk' -import { StatusCodes, TransportStatusError } from '@ledgerhq/errors' +import { + DisconnectedDeviceDuringOperation, + StatusCodes, + TransportStatusError, +} from '@ledgerhq/errors' import TransportNodeHid from '@ledgerhq/hw-transport-node-hid' import IronfishApp, { KeyResponse, @@ -45,6 +49,8 @@ export class Ledger { throw new LedgerPortIsBusyError() } else if (LedgerConnectError.IsError(e)) { throw new LedgerConnectError() + } else if (e instanceof DisconnectedDeviceDuringOperation) { + throw new LedgerConnectError() } if (error instanceof TransportStatusError) {