diff options
Diffstat (limited to 'src/headless')
-rw-r--r-- | src/headless/helpers.ts | 2 | ||||
-rw-r--r-- | src/headless/taler-wallet-cli.ts | 15 |
2 files changed, 13 insertions, 4 deletions
diff --git a/src/headless/helpers.ts b/src/headless/helpers.ts index e451db55b..3b2f65313 100644 --- a/src/headless/helpers.ts +++ b/src/headless/helpers.ts @@ -79,7 +79,7 @@ export async function getDefaultNodeWallet( const dbContent = JSON.parse(dbContentStr); myBackend.importDump(dbContent); } catch (e) { - console.error("could not read wallet file"); + logger.warn("could not read wallet file"); } myBackend.afterCommitCallback = async () => { diff --git a/src/headless/taler-wallet-cli.ts b/src/headless/taler-wallet-cli.ts index ca168bf8a..2502ec7db 100644 --- a/src/headless/taler-wallet-cli.ts +++ b/src/headless/taler-wallet-cli.ts @@ -30,7 +30,10 @@ import { setupRefreshPlanchet, encodeCrock, } from "../crypto/talerCrypto"; -import { OperationFailedAndReportedError } from "../operations/errors"; +import { + OperationFailedAndReportedError, + OperationFailedError, +} from "../operations/errors"; import { Bank } from "./bank"; import { classifyTalerUri, TalerUriType } from "../util/taleruri"; import { Configuration } from "../util/talerconfig"; @@ -167,9 +170,15 @@ async function withWallet<T>( const ret = await f(wallet); return ret; } catch (e) { - if (e instanceof OperationFailedAndReportedError) { + if ( + e instanceof OperationFailedAndReportedError || + e instanceof OperationFailedError + ) { console.error("Operation failed: " + e.message); - console.log("Hint: check pending operations for details."); + console.error( + "Error details:", + JSON.stringify(e.operationError, undefined, 2), + ); } else { console.error("caught unhandled exception (bug?):", e); } |