Skip to content
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

Simpler Error Model for ldk-server #20

Merged
merged 6 commits into from
Nov 7, 2024

Conversation

G8XSU
Copy link
Contributor

@G8XSU G8XSU commented Nov 5, 2024

Alternative to #19

Main difference being, we will add error_details model later.

Only last 2 commits are of importance.

  • Adds proto definition for api errors.
    • When HttpStatusCode is not ok (200), the response content contains a serialized ErrorResponse.
  • Add error struct for LdkServerError.
    • It is mainly used as error struct that will be returned from internal layers of ldk-server implementation.
    • It will be converted to proto::error::ErrorResponse at top level service layer.
    • It is intentionally kept flat instead of nesting of fields in enum, so that we can re-use something similar in ldk-server-client. A flat structure without nesting of enums/string might be helpful in case we want to generate ldk-server-client bindings later.

@G8XSU G8XSU requested a review from jkczyz November 5, 2024 18:40
@G8XSU G8XSU requested a review from jkczyz November 6, 2024 23:45
Copy link

@jkczyz jkczyz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Please squash.

@G8XSU G8XSU requested a review from jkczyz November 7, 2024 16:13
@G8XSU G8XSU merged commit 82162e2 into lightningdevkit:main Nov 7, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants