mirror of
https://github.com/fusion44/blitz_api.git
synced 2026-08-13 11:52:45 +02:00
Decoding a malformed or wrong-network invoice (e.g. a regtest lnbcrt... invoice on a mainnet node) made each backend fail with a cryptic, leaked error: LND with the Go 'strconv.ParseUint: parsing "rt500": invalid syntax' surfaced as a 500, and CLN with 'Invalid bolt11: ...'. Add a shared helper raise_for_pay_req_decode_error() in lightning/utils that recognizes the decode-failure signatures of both backends and raises one clear 400 pointing at the likely cause (malformed or wrong network). Wire LND (lnd_grpc), CLN gRPC and CLN JSON-RPC through it so they behave identically; genuine backend errors still return 500. Fixes #225 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| impl | ||
| docs.py | ||
| exceptions.py | ||
| models.py | ||
| router.py | ||
| service.py | ||
| utils.py | ||