Skip to content

Comments

Simpler Error Model for ldk-server#20

Merged
G8XSU merged 6 commits intolightningdevkit:mainfrom
G8XSU:error-model-2
Nov 7, 2024
Merged

Simpler Error Model for ldk-server#20
G8XSU merged 6 commits intolightningdevkit:mainfrom
G8XSU:error-model-2

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
Contributor

@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
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