embedded: fix DB deletion status code check

This commit is contained in:
Florian Dold 2023-02-23 20:13:35 +01:00
parent f7c97f73bb
commit 3d1b1ec724
No known key found for this signature in database
GPG Key ID: D2E4F00F29D02A4B

View File

@ -143,17 +143,8 @@ class NativeWalletMessageHandler {
this.walletArgs = { ...oldArgs }; this.walletArgs = { ...oldArgs };
if (oldArgs && oldArgs.persistentStoragePath) { if (oldArgs && oldArgs.persistentStoragePath) {
const ret = qjsOs.remove(oldArgs.persistentStoragePath); const ret = qjsOs.remove(oldArgs.persistentStoragePath);
if (ret != null) { if (ret != 0) {
return { logger.error("removing DB file failed");
type: "error",
id,
operation,
error: {
code: TalerErrorCode.GENERIC_UNEXPECTED_REQUEST_ERROR,
hint: `path ${oldArgs.persistentStoragePath}`,
message: "removing DB file failed",
},
};
} }
// Prevent further storage! // Prevent further storage!
this.walletArgs.persistentStoragePath = undefined; this.walletArgs.persistentStoragePath = undefined;
@ -200,7 +191,7 @@ export function installNativeWalletListener(): void {
msg.args ?? {}, msg.args ?? {},
); );
logger.info( logger.info(
`native listener: sending success response for ${operation} (${id})`, `native listener: sending ${respMsg.type} response for ${operation} (${id})`,
); );
sendNativeMessage(respMsg); sendNativeMessage(respMsg);
} catch (e) { } catch (e) {