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

Wrap validation errors #493

Merged
merged 2 commits into from
Apr 9, 2019
Merged

Wrap validation errors #493

merged 2 commits into from
Apr 9, 2019

Conversation

htdvisser
Copy link
Contributor

@htdvisser htdvisser commented Apr 8, 2019

Summary:

This PR wraps the validation errors introduced in #194 so that they can be communicated over gRPC.

Changes:

As an additional change, I fixed the formatting of error cause stacks in the CLI

Notes for Reviewers:

This is technically an API change, because we now start communicating these errors over GRPC if they are the cause of an RPC to fail. However, these causes are only informative, so I didn't attach the compat/api label.

% go run ./cmd/ttn-lw-cli app create admin_app --user-id admin
error:pkg/ttnpb:identifiers (invalid identifiers)
    correlation_id=50b56c3f59654d68b5f52edb37302f32
--- error:pkg/errors:validation (invalid `application_id`: value does not match regex pattern "^[a-z0-9](?:[-]?[a-z0-9]){2,}$")
    name=ApplicationIdentifiersValidationError
    field=application_id
    reason=value does not match regex pattern "^[a-z0-9](?:[-]?[a-z0-9]){2,}$"
exit status 255

@htdvisser htdvisser added c/shared This is shared between components ui/cli This is related to ttn-lw-cli labels Apr 8, 2019
@htdvisser htdvisser added this to the April 2019 milestone Apr 8, 2019
@htdvisser htdvisser self-assigned this Apr 8, 2019
@htdvisser htdvisser requested a review from johanstokking April 8, 2019 09:51
@htdvisser htdvisser merged commit 920be00 into master Apr 9, 2019
@htdvisser htdvisser deleted the feature/validation-errors branch April 9, 2019 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c/shared This is shared between components ui/cli This is related to ttn-lw-cli
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants