taler-wallet-embedded: improve awkward log message
This commit is contained in:
parent
f5f3d3e23c
commit
d4dd82eda1
@ -183,26 +183,21 @@ export function installNativeWalletListener(): void {
|
|||||||
const id = msg.id;
|
const id = msg.id;
|
||||||
logger.info(`native listener: got request for ${operation} (${id})`);
|
logger.info(`native listener: got request for ${operation} (${id})`);
|
||||||
|
|
||||||
|
let respMsg: CoreApiResponse;
|
||||||
try {
|
try {
|
||||||
const respMsg = await handler.handleMessage(
|
respMsg = await handler.handleMessage(operation, id, msg.args ?? {});
|
||||||
operation,
|
|
||||||
id,
|
|
||||||
msg.args ?? {},
|
|
||||||
);
|
|
||||||
logger.info(
|
|
||||||
`native listener: sending ${respMsg.type} response for ${operation} (${id})`,
|
|
||||||
);
|
|
||||||
sendNativeMessage(respMsg);
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
const respMsg: CoreApiResponse = {
|
respMsg = {
|
||||||
type: "error",
|
type: "error",
|
||||||
id,
|
id,
|
||||||
operation,
|
operation,
|
||||||
error: getErrorDetailFromException(e),
|
error: getErrorDetailFromException(e),
|
||||||
};
|
};
|
||||||
sendNativeMessage(respMsg);
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
logger.info(
|
||||||
|
`native listener: sending back ${respMsg.type} message for operation ${operation} (${id})`,
|
||||||
|
);
|
||||||
|
sendNativeMessage(respMsg);
|
||||||
};
|
};
|
||||||
|
|
||||||
qjsOs.setMessageFromHostHandler((m) => onMessage(m));
|
qjsOs.setMessageFromHostHandler((m) => onMessage(m));
|
||||||
|
Loading…
Reference in New Issue
Block a user