diff --git a/src/components/Faucet.tsx b/src/components/Faucet.tsx index 7a10018..78a957d 100644 --- a/src/components/Faucet.tsx +++ b/src/components/Faucet.tsx @@ -71,7 +71,12 @@ export function Faucet() { }); if (!res.ok) { - throw new Error(await res.text()); + const text = await res.text(); + if (text.startsWith("")) { + throw new Error("Rate limit exceeded"); + } else { + throw new Error(text); + } } else { let json = await res.json(); return { txid: json.txid, howMuchSats, toAddress: json.address }; diff --git a/src/components/LnFaucet.tsx b/src/components/LnFaucet.tsx index a664504..07a278f 100644 --- a/src/components/LnFaucet.tsx +++ b/src/components/LnFaucet.tsx @@ -73,7 +73,12 @@ export function LnFaucet() { }); if (!res.ok) { - throw new Error(await res.text()); + const text = await res.text(); + if (text.startsWith("")) { + throw new Error("Rate limit exceeded"); + } else { + throw new Error(text); + } } else { return res.json(); }