commit 59071e0e4a2ba260643e5efe924c266c00972273
parent 6cc957a8a7e3596874799bf7db1e1c81dcb75480
Author: Florian Dold <florian@dold.me>
Date: Wed, 15 Jul 2026 20:28:02 +0200
use error code for cancelled request
Diffstat:
2 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/packages/taler-wallet-core/src/common.ts b/packages/taler-wallet-core/src/common.ts
@@ -931,7 +931,10 @@ export async function genericWaitForState(
try {
while (true) {
if (wex.cancellationToken.isCancelled) {
- throw Error("cancelled");
+ throw TalerError.fromDetail(
+ TalerErrorCode.WALLET_CORE_REQUEST_CANCELLED,
+ {},
+ );
}
if (await args.checkState()) {
return;
@@ -982,7 +985,10 @@ export async function genericWaitForStateVal<T>(
try {
while (true) {
if (wex.cancellationToken.isCancelled) {
- throw Error("cancelled");
+ throw TalerError.fromDetail(
+ TalerErrorCode.WALLET_CORE_REQUEST_CANCELLED,
+ {},
+ );
}
const val = await args.checkState();
if (val != null) {
diff --git a/packages/taler-wallet-core/src/exchanges.ts b/packages/taler-wallet-core/src/exchanges.ts
@@ -2755,8 +2755,10 @@ export async function getExchangeTos(
while (1) {
if (progressContext?.cts?.token.isCancelled || progressContext?.finished) {
- // FIXME: Error code!
- throw Error("cancelled");
+ throw TalerError.fromDetail(
+ TalerErrorCode.WALLET_CORE_REQUEST_CANCELLED,
+ {},
+ );
}
try {
const tosRes = await exchangeClient.getTermsText({