diff options
Diffstat (limited to 'packages/taler-wallet-core/src/operations/backup')
-rw-r--r-- | packages/taler-wallet-core/src/operations/backup/index.ts | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/packages/taler-wallet-core/src/operations/backup/index.ts b/packages/taler-wallet-core/src/operations/backup/index.ts index a44e8f55a..27d27da0d 100644 --- a/packages/taler-wallet-core/src/operations/backup/index.ts +++ b/packages/taler-wallet-core/src/operations/backup/index.ts @@ -627,8 +627,7 @@ export const codecForAddBackupProviderRequest = export type AddBackupProviderResponse = | AddBackupProviderOk - | AddBackupProviderPaymentRequired - | AddBackupProviderError; + | AddBackupProviderPaymentRequired; interface AddBackupProviderOk { status: "ok"; @@ -637,10 +636,6 @@ interface AddBackupProviderPaymentRequired { status: "payment-required"; talerUri?: string; } -interface AddBackupProviderError { - status: "error"; - error: TalerErrorDetail; -} export const codecForAddBackupProviderOk = (): Codec<AddBackupProviderOk> => buildCodecForObject<AddBackupProviderOk>() @@ -654,13 +649,6 @@ export const codecForAddBackupProviderPaymenrRequired = .property("talerUri", codecOptional(codecForString())) .build("AddBackupProviderPaymentRequired"); -export const codecForAddBackupProviderError = - (): Codec<AddBackupProviderError> => - buildCodecForObject<AddBackupProviderError>() - .property("status", codecForConstString("error")) - .property("error", codecForTalerErrorDetail()) - .build("AddBackupProviderError"); - export const codecForAddBackupProviderResponse = (): Codec<AddBackupProviderResponse> => buildCodecForUnion<AddBackupProviderResponse>() @@ -670,7 +658,6 @@ export const codecForAddBackupProviderResponse = "payment-required", codecForAddBackupProviderPaymenrRequired(), ) - .alternative("error", codecForAddBackupProviderError()) .build("AddBackupProviderResponse"); export async function addBackupProvider( @@ -745,10 +732,10 @@ async function runFirstBackupCycleForProvider( const resp = await runBackupCycleForProvider(ws, args); switch (resp.type) { case OperationAttemptResultType.Error: - return { - status: "error", - error: resp.errorDetail, - }; + throw TalerError.fromDetail( + TalerErrorCode.WALLET_UNEXPECTED_EXCEPTION, + resp.errorDetail, + ); case OperationAttemptResultType.Finished: return { status: "ok", |