Skip to content

Conversation

@migmartri
Copy link
Member

@migmartri migmartri commented Aug 15, 2024

Shows just the gRPC error not the whole wrapped chain to the user for expected gRPC errors.

Examples

Before

$ go run main.go --insecure org api-token create --name test
ERR creating API token: creating API token: rpc error: code = AlreadyExists desc = duplicated: name already taken

after

$ go run main.go --insecure org api-token create --name test
ERR duplicated: name already taken

before

$ go run main.go --insecure org api-token create --name test_foo
ERR creating API token: creating API token: rpc error: code = InvalidArgument desc = validation error: "test_foo": a lowercase RFC 1123 label must consist of lower case alphanumeric characters or '-', and must start and end with an alphanumeric character (e.g. 'my-name',  or '123-abc', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?')

after

$ go run main.go --insecure org api-token create --name test_foo
ERR validation error: "test_foo": a lowercase RFC 1123 label must consist of lower case alphanumeric characters or '-', and must start and end with an alphanumeric character (e.g. 'my-name',  or '123-abc', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?')

fixes #1207

Signed-off-by: Miguel <miguel@chainloop.dev>
Signed-off-by: Miguel <miguel@chainloop.dev>
@migmartri migmartri requested review from javirln and jiparis August 15, 2024 08:25
@migmartri migmartri merged commit 351ec02 into chainloop-dev:main Aug 16, 2024
@migmartri migmartri deleted the fix-error-message branch August 16, 2024 09:21
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.

improve how we show validation errors

3 participants