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
When creating a pull request via PullRequests.Create if the specified from branch / to branch is not found, bitbucket will return 404 not found. But the contents of the response will be a JSON structure that explains what was not found.
The issue is this JSON response is never read if the HTTP status code is 404.
The exception thrown is:
POST operation unsuccessful. Got HTTP status code 404.
I have modified a local checkout of the code to add reading the response data, which provides me the JSON error details as text in the exception:
Modified code - HttpCommunicationWorker, Line 97:
string error = await httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
throw new Exception(string.Format("POST operation unsuccessful. Got HTTP status code '{0}' \nContent:\n{1}", httpResponse.StatusCode, error));
This is not ideal as it would be nice to deserialize the JSON error response to some sort of class structure.
Thanks.
The text was updated successfully, but these errors were encountered:
When creating a pull request via PullRequests.Create if the specified from branch / to branch is not found, bitbucket will return 404 not found. But the contents of the response will be a JSON structure that explains what was not found.
The issue is this JSON response is never read if the HTTP status code is 404.
The exception thrown is:
POST operation unsuccessful. Got HTTP status code 404.
I have modified a local checkout of the code to add reading the response data, which provides me the JSON error details as text in the exception:
Modified code - HttpCommunicationWorker, Line 97:
This is not ideal as it would be nice to deserialize the JSON error response to some sort of class structure.
Thanks.
The text was updated successfully, but these errors were encountered: