lnbits / lndhub

Access lnbits from BlueWallet or Zeus
MIT License
5 stars 6 forks source link

Bluewallet API and error handling #20

Closed limpbrains closed 4 months ago

limpbrains commented 8 months ago

When I'm tyring to pay invoice with amount bigger than I have, LNbits returns 404 error with json body: {"detail": "Payment failed"}

Bluewallet expects json to contain error field in case of the error https://github.com/BlueWallet/BlueWallet/blob/2ea7a17bb6d0651cf84426f9d2ca2817bc78cd3b/class/wallets/lightning-custodian-wallet.js#L137

I can fix this by changing BW, but it feels like this issue should also be fixed in lnbits/lndhub

related https://github.com/BlueWallet/BlueWallet/issues/5597

dni commented 8 months ago

returning {"error": "payment failed"} with status 200 seems to work for Zeus can you try it for bluewallet? https://github.com/lnbits/lndhub/pull/22

limpbrains commented 7 months ago

Yes, it should work. Can't test it right now, but looking at the BW code, I can say so