-
Notifications
You must be signed in to change notification settings - Fork 46
Add Domain Specific Error Handling for Trampoline Payments #604
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
bc74d44 to
70581bd
Compare
|
Very nice changes. I'd just like to move the error into a separate module, so we don't make |
cdecker
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking very good now 👍
@nepet is this good to go?
Introduces a custom error module, providing a comprehensive error handling system. The module offers a generic, extensible approach to error management with rich context. Key features: - Generic GreenlightError<C> type that works with custom error codes - Seamless conversion between custom errors and tonic::Status - Structured error details with JSON serialization for gRPC transport - User-friendly messages with optional hints for resolution The framework enables consistent error handling across services while maintaining gRPC compatibility and providing detailed error information for both users and developers. Signed-off-by: Peter Neuroth <pet.v.ne@gmail.com>
Migrates from generic anyhow::Error to strongly-typed TrampolineError throughout the trampoline_pay implementation. This provides better error categorization and improved diagnostics. Changes: - Implement TrampolineError using the greenlight_error framework - Define TrampolineErrCode enum with specific error cases (42701-42714) - Add conversion from CLN RPC errors with code preservation - Replace all anyhow::Error usage with appropriate TrampolineError types - Add convenience constructors for common error scenarios Signed-off-by: Peter Neuroth <pet.v.ne@gmail.com>
In order to access the TrampolineError from the internal gl plugin we need to make it public. Signed-off-by: Peter Neuroth <pet.v.ne@gmail.com>
When hitting an error on trampoline_pay we just reported a generic status UNKNOWN to the caller. This commit wires the actual status trhough. This allows the caller to receive a detailed explaination of the underlying error that caused the failed payment. Signed-off-by: Peter Neuroth <pet.v.ne@gmail.com>
Signed-off-by: Peter Neuroth <pet.v.ne@gmail.com>
We wan't to be able to use the error framework across diferent greenlight crates. The util crate is a good place to store some common functionalities. Signed-off-by: Peter Neuroth <pet.v.ne@gmail.com>
Signed-off-by: Peter Neuroth <pet.v.ne@gmail.com>
79c0ff8 to
caf1005
Compare
|
Rebased and going to merge asap. This likely forces us to make the next update a major version bump, but that's ok, we're getting new functionality with it. |
This PR introduces a comprehensive error handling framework for trampoline payments, replacing generic
anyhow::Errorusage with strongly-typed, domain-specific errors. The error handling provides better error categorization, improved diagnostics, and seamless gRPC integration. It also adds rich error context with hints for developers and users while surviving serialization into gRPC statuses for usage across service boundaries.