rust-lightning icon indicating copy to clipboard operation
rust-lightning copied to clipboard

`lightning-liquidity`: Introduce better error types

Open tnull opened this issue 3 months ago • 4 comments

In lightning-liqudity we historically at some point went with reusing LDK's APIError type, which was a weird choice even back then.

However, we since added a bunch of additional error cases, and at the very least since #4008 (where we had to use APIError for inline persistence errors), APIError makes no sense anymore.

We should introduce a dedicated error type with clearly documented variants for lightning-liquidity and use it throughout the LSPS1/2/5 APIs.

tnull avatar Sep 16 '25 12:09 tnull

Post-https://github.com/lightningdevkit/rust-lightning/pull/4160 we should def. also create a separate error variant for 'HTLC intercepted failed due to unknown SCID'.

tnull avatar Oct 16 '25 08:10 tnull

Hi @tnull @martinsaposnic could I give it a try at this issue?

f3r10 avatar Oct 31 '25 21:10 f3r10

Hi @tnull @martinsaposnic could I give it a try at this issue?

Thanks for showing interest here! While the actual code changes should be trivial, this would be a rather substantial refactor in terms of API design. As it will require a bunch of context (esp about the shortcomings we found in our current design), it's probably no 'good first issue'.

tnull avatar Nov 03 '25 09:11 tnull

Oh ok @tnull, thanks for the advice. I am going to look for a 'good first issue'

f3r10 avatar Nov 04 '25 10:11 f3r10