You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Instead of only returning the status code to the user of the SDK, it would be helpful if the SDK also returned the error message returned by Connect, if available.
Use cases
This makes it way easier to debug problems, especially validations issues.
If you currently try to create a new Item, but it does not adhere to the required structure, you only get this response:
Unable to create item. Receieved "400 Bad Request" for "/v1/vaults/UUID/items "
Proposed solution
I propose two possible solutions:
Append the error message to the current string-based error message. I.e. Unable to create item. Receieved "400 Bad Request" for "/v1/vaults/UUID/items": Validation: (validateVaultItem failed to Validate), Couldn't validate the item: "[ItemValidator] has found 1 errors, 0 warnings: \nErrors:{1. details.sections[0].fields[0] has unsupported field type}"
Create a custom error type that exposes the status code and the message to the user of the SDK.
The second option is a little more involved, but I think it's the most flexible to work with and is my preferred option.
The text was updated successfully, but these errors were encountered:
Summary
Instead of only returning the status code to the user of the SDK, it would be helpful if the SDK also returned the error message returned by Connect, if available.
Use cases
This makes it way easier to debug problems, especially validations issues.
If you currently try to create a new Item, but it does not adhere to the required structure, you only get this response:
Proposed solution
I propose two possible solutions:
Unable to create item. Receieved "400 Bad Request" for "/v1/vaults/UUID/items": Validation: (validateVaultItem failed to Validate), Couldn't validate the item: "[ItemValidator] has found 1 errors, 0 warnings: \nErrors:{1. details.sections[0].fields[0] has unsupported field type}"
The second option is a little more involved, but I think it's the most flexible to work with and is my preferred option.
The text was updated successfully, but these errors were encountered: