Please describe the feature you’d like to see added.
It’s becoming increasingly difficult to reliably map and handle errors originating from Bitcoin Core. The primary challenge stems from the frequent changes in both the error codes and the descriptive error text.
Problem Description Our current error-handling logic relies on parsing the responses from Bitcoin Core. However, this approach is fragile for two main reasons:
Unstable Error Codes: The numerical error codes returned by Bitcoin Core are not stable across versions. An error code that signifies a specific issue in one version might be changed or removed in a future update, which breaks any logic that depends on matching these codes.
Changing Error Messages: Relying on string matching of the error messages is also unreliable. The text of these messages is frequently rephrased, updated, or otherwise modified between releases. This makes text-based error detection brittle and requires constant maintenance to keep up with the changes in Core.
This instability creates a significant maintenance burden, as our error-handling code needs to be constantly revisited and updated to align with the latest changes in Bitcoin Core.
A clear example of this ongoing struggle can be seen in this related issue/PR, which highlights the effort required to adapt to these changes: https://github.com/btcsuite/btcwallet/pull/1053
Seeking a More Robust Solution Given these challenges, we are looking for better strategies to interpret errors from Bitcoin Core that are less susceptible to these frequent upstream changes.
We are open to any tips or suggestions how to handle this. Are there more resilient patterns for error handling in this context that we should consider? Any advice would be greatly appreciated.
Is your feature related to a problem, if so please describe it.
No response
Describe the solution you’d like
No response
Describe any alternatives you’ve considered
No response
Please leave any additional context
No response