commit fafe5562174b044dce46f551f0767fb4001471d7
parent ce1ac856d0f7cf2f0395a8e0027e6b9f6e7a5d1e
Author: Florian Dold <dold@taler.net>
Date: Fri, 31 Jul 2026 12:55:33 +0200
ui: report the right error for a malformed refund URI
The nested switch on the path position had no default, so a refund URI with an
unexpected position fell through to the next case and was reported as an
invalid exchange host.
Diffstat:
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/packages/taler-wallet-webextension/src/wallet/QrReader.tsx b/packages/taler-wallet-webextension/src/wallet/QrReader.tsx
@@ -284,6 +284,8 @@ function translateTalerUriError(
return i18n.str`The merchant host is invalid`;
case 1:
return i18n.str`The URI should end with /`;
+ default:
+ return assertUnreachable(result.detail);
}
}
case TalerUriAction.PayPush:
@@ -513,7 +515,7 @@ export function QrReaderPage({ onDetected }: Props): VNode {
case TalerUriAction.AddContact:
return <i18n.Translate>Add contact</i18n.Translate>;
default: {
- assertUnreachable(talerUri);
+ return assertUnreachable(talerUri);
}
}
})(uri)}
@@ -594,7 +596,7 @@ async function testValidUri(
return undefined;
}
default: {
- assertUnreachable(uri);
+ return assertUnreachable(uri);
}
}
}
@@ -624,7 +626,7 @@ async function checkExchangeUrl(
return i18n.str`Couldn't find an exchange in the URL specified.`;
}
default: {
- assertUnreachable(config);
+ return assertUnreachable(config);
}
}
}
@@ -662,7 +664,7 @@ async function checkMerchantUrl(
return i18n.str`Couldn't find a merchant in the URL specified.`;
}
default: {
- assertUnreachable(config);
+ return assertUnreachable(config);
}
}
}
@@ -700,7 +702,7 @@ async function checkBankUrl(
return i18n.str`Couldn't find a bank in the URL specified.`;
}
default: {
- assertUnreachable(config);
+ return assertUnreachable(config);
}
}
}