Skip to content

Conversation

@colin99d
Copy link
Contributor

This pr adds a new Other enum item to AuthResponse, which allows us to capture any json, and display it. Output goes from:

AuthError(RequestError(RequestError(reqwest::Error { kind: Decode, source: Error("data did not match any variant of untagged enum AuthResponse", line: 0, column: 0) })))

To
AuthError(UnexpectedResponse(Some(Object {"code": String("390186"), "data": Object {"age": Number(0), "errorCode": String("390186"), "internalError": Bool(false)}, "headers": Null, "message": String("Role 'ACCOUNTADMIN' specified in the connect string is not granted to this user. Contact your local system administrator, or attempt to login with another role, e.g. PUBLIC."), "success": Bool(false)})))

Which, in my opinion, is MUCH more actionable. True to my notes in the issue, I used the data received from the response to better implement the given error, and got the even cleaner response of:
AuthError(AuthFailed("390186", "Role 'ACCOUNTADMIN' specified in the connect string is not granted to this user. Contact your local system administrator, or attempt to login with another role, e.g. PUBLIC."))

This PR is purposely left dirty. Please provide general feedback for me to implement, and tell me whether you like the general idea, and then I will go through and clean everything up.

Closes #31

@colin99d colin99d changed the title First attempt at improved error handling First attempt at improved error handling (and bumps arrow to 51) Mar 28, 2024
@colin99d
Copy link
Contributor Author

colin99d commented Jun 4, 2024

@andrusha any comments on this?

@colin99d colin99d changed the title First attempt at improved error handling (and bumps arrow to 51) First attempt at improved error handling Jun 24, 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.

Output errors don't get parsed into an error properly.

1 participant