Skip to content

Please include the root cause in the exception message #83

Description

@guidolx

Please include the root cause in the exception message in com.zitadel.ApiException class.
Currently, com.zitadel.ApiException.getMessage() returns a concatenation of "Error " and status code; the error returned is "Error 400", which is the HTTP status code for a bad client request.

For example, if I provide an invalid organisation name criterion for a search request that exceeds 200 characters, the root cause can be found in the response body, which contains the following content for the above example:
{"code": "invalid_argument", "message": "invalid ListOrganizationsRequest.Queries[0]: embedded message failed validation | caused by: invalid SearchQuery.NameQuery: embedded message failed validation | caused by: invalid OrganizationNameQuery.Name: value length must be between 1 and 200 runes, inclusive"}.

A more user-friendly error message from com.zitadel.ApiException.getMessage(): "Error 400: invalid OrganizationNameQuery.Name: value length must be between 1 and 200 runes, inclusive"

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

Priority

None yet

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions