paivana

HTTP paywall reverse proxy
Log | Files | Refs | Submodules | README | LICENSE

commit 4985c4ec92f766f8ad6cb590c56ea5e8b79d4c17
parent 7e084236d3b821fdeceecedf48471c3ec6a5e407
Author: Christian Grothoff <christian@grothoff.org>
Date:   Wed, 29 Apr 2026 23:33:39 +0200

make error messages slightly nicer

Diffstat:
Mcontrib/paywall.en.must | 8++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/contrib/paywall.en.must b/contrib/paywall.en.must @@ -126,7 +126,7 @@ body: JSON.stringify({ order_id: orderId, nonce, cur_time: { t_s: expTime }, website }), }); if (res.status >= 400) { - talerLink.textContent = 'Something went wrong'; + talerLink.textContent = 'Payment confirmed, but something went wrong when we tried to obtain the access token. This is a bug, please contact the operator if the issue persists.'; const preError = document.createElement("pre") preError.style = "text-wrap-mode = wrap"; preError.innerText = JSON.stringify(await res.json()) @@ -136,7 +136,7 @@ await waitMs(400); location.href = dest; } catch (e) { - console.warn('[paivana] confirm error:', e); + console.warn('[paivana] Error trying to confirm payment:', e); talerLink.textContent = 'Could not reach the server!'; } } @@ -157,11 +157,11 @@ if (res.status === 200) { let info = null; try { info = await res.json() } catch (_) {} - console.log("got reponse from backend", res, info); + console.log("[paivana] Got reponse from backend", res, info); if (info.order_id) { await confirmPayment(info.order_id); } else { - // FIXME: for testing... + talerLink.textContent = 'Unexpected 200 OK response without an order_id. Trying again.'; await waitMs(400); location.href = website; }