diff options
author | Florian Dold <florian.dold@gmail.com> | 2017-04-28 23:28:27 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2017-04-28 23:28:27 +0200 |
commit | d6bf24902a34f2094363121c8d9f4d54db6f7b6c (patch) | |
tree | 0794956ebdf91a2fbea16baa0e8aa559f45c5d06 /src/wxBackend.ts | |
parent | ce97b1076b7e4a53b84d3fd34bf2047580ddeb22 (diff) | |
download | wallet-core-d6bf24902a34f2094363121c8d9f4d54db6f7b6c.tar.xz |
implement new reserve creation dialog and auditor management
Diffstat (limited to 'src/wxBackend.ts')
-rw-r--r-- | src/wxBackend.ts | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/wxBackend.ts b/src/wxBackend.ts index 984cad21a..716dc66be 100644 --- a/src/wxBackend.ts +++ b/src/wxBackend.ts @@ -167,6 +167,12 @@ function makeHandlers(db: IDBDatabase, } return wallet.updateExchangeFromUrl(detail.baseUrl); }, + ["currency-info"]: function (detail) { + if (!detail.name) { + return Promise.resolve({ error: "name missing" }); + } + return wallet.getCurrencyRecord(detail.name); + }, ["hash-contract"]: function (detail) { if (!detail.contract) { return Promise.resolve({ error: "contract missing" }); @@ -289,13 +295,20 @@ async function dispatch(handlers: any, req: any, sender: any, sendResponse: any) console.log(`exception during wallet handler for '${req.type}'`); console.log("request", req); console.error(e); + let stack = undefined; + try { + stack = e.stack.toString(); + } catch (e) { + // might fail + } try { sendResponse({ + stack, error: "exception", hint: e.message, - stack: e.stack.toString() }); } catch (e) { + console.log(e); // might fail if tab disconnected } } |