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

fix: Propagate dev server errors in CLI compatible format #412

Merged

Conversation

mike-zorn
Copy link
Contributor

This makes it so that errors from the dev server are propagated back to the CLI in a way that the CLI can reasonably render. This way, we can return something that gives the user an idea of what went wrong vs. a generic "unexpected error" message.

example

❯ ldcli dev-server add-project --project jimbo-jones --source staging
unable to get SDK key from LD API: 404 Not Found (code: internal_server_error)

)

type errorHandler struct {
code string
Copy link
Member

Choose a reason for hiding this comment

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

nit: Code seems like a strange name for this. It looks like statusText.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Tragically, this is the convention in our API.

Copy link
Member

Choose a reason for hiding this comment

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

Cool. I figured there was a reason for it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added a comment to indicate that this is not ideal.

@mike-zorn mike-zorn merged commit 67cc93a into main Aug 26, 2024
7 checks passed
@mike-zorn mike-zorn deleted the mikezorn/sc-253913/project-create-errors-aren-t-propagated-to branch August 26, 2024 17:07
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.

3 participants