-
Notifications
You must be signed in to change notification settings - Fork 696
Bitbucket Cloud: provide custom raise_for_status #925
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bitbucket Cloud: provide custom raise_for_status #925
Conversation
The default one in AtlassianRestAPI does not work for Bitbucket Cloud. Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Found this one while trying to make #904 work for Bitbucket Cloud. |
It'll be better if we just revert 50b5c71 instead of adding error handling one by one |
What was the behavior before? To me it looks like before it just used the HTTP error message which is useless in many cases. It is definitely better to show the actual error message from the JSON response. But it seems that the JSON format is different for each service... |
If you look the tagged commit carefully you'll see it was showing proper error message from json data. Also it has different error handling for each service. |
That might be true for some services, but that commit did not remove any error handling from
With my patch you get:
So I think this is a definite improvement for Bitbucket Cloud specifically. |
How about reverting that commit and keeping your patch too? |
I don't have a specific opinion on that. But I will definitely not make that part of my PR. |
@salmannotkhan does it really need to be revert it ? |
Okay, let me explain what happened. I'm using this library for 6 months never faced any issues. But one day I was making a python script to update labels on every bitbucket that I have. I didn't know that repo labels can't contain uppercase characters. So I tried to set labels that are uppercase but instead of returning the error from API saying that "Labels can't contain the uppercase letter" I got a KeyError: "errorMessage" key doesn't exist on d or Something like that. That means error messages aren't handled properly after the try to handle all errors messages singly because each service has its error message format. |
@salmannotkhan noted thank you. My bad in that situation. |
Yup only BB cloud will be fine for now because that is only causing errors for me |
@salmannotkhan let me upload a new release. |
No problem, sir it's a great library for atlassian services |
@clrusby sure! |
What I wrote doesn’t actually work for bitbucket server as errors is a |
The default one in AtlassianRestAPI does not work for Bitbucket Cloud. Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
The default one in AtlassianRestAPI does not work
for Bitbucket Cloud.
Signed-off-by: Frank Lichtenheld frank@lichtenheld.com