-
Type:
Suggestion
-
Resolution: Unresolved
-
Component/s: API Framework - Querying
-
None
-
3
This request is to provide better error messages when the user faces an error with Bitbucket Cloud API.
For example, the List Pull Request API.
If a user tries to query for a state="ALL", which is not a supported value for the state parameter, the user will see a 500 error.
Here is the example request:
curl -L -X GET --user <username>:<app_password> 'https://api.bitbucket.org/2.0/repositories/<workspace-id>/<repo-slug>/pullrequests?q=state="ALL"'
Error message:
response: {"type": "error", "error": {"message": "Something went wrong", "id": "<error code>"}}
This is not helpful for the user and doesn't indicate that it was bad user input that caused the issue.