Skip to content
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

[formrecognizer] include error code for errors that occur during polling #12621

Merged
merged 6 commits into from
Jul 22, 2020

Conversation

kristapratico
Copy link
Member

No description provided.

@kristapratico kristapratico added Client This issue points to a problem in the data-plane of the library. Cognitive - Form Recognizer labels Jul 20, 2020
@kristapratico kristapratico self-assigned this Jul 20, 2020
for err in errors:
message += "({}) {}\n".format(err["code"], err["message"])
raise HttpResponseError(message=message, response=response)
error_message = "({}) {}{}".format(errors[0]["code"], errors[0]["message"], message)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aligning with other languages to raise the first error in the list

@kristapratico kristapratico marked this pull request as ready for review July 21, 2020 16:02
poller = client.begin_copy_model(model.model_id, target=target)
copy = poller.result()
except HttpResponseError as e:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had a test similar to this and I thought it was passing, but it turns out it wasn't actually raising an HttpResponseError, so none of my asserts were actually being checked. Definitely recommend using with pytest.raises. Example here

Copy link
Contributor

@iscai-msft iscai-msft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚢

@kristapratico kristapratico merged commit 55985c4 into Azure:master Jul 22, 2020
@kristapratico kristapratico deleted the fix-error-code branch July 22, 2020 21:26
iscai-msft added a commit to iscai-msft/azure-sdk-for-python that referenced this pull request Jul 29, 2020
…into regenerate_keys

* 'master' of https://github.com/Azure/azure-sdk-for-python: (24 commits)
  rename FormField.type -> FormField.value_type (Azure#12708)
  20200703 codereport (Azure#12361)
  Use the common Cosmos emulator template. (Azure#12678)
  Add azurestackhci ci.yml for pipeline generation. (Azure#12701)
  [ServiceBus] Resend received message (Azure#12457)
  AZURE_CLIENT_ID sets user-assigned managed identity for DefaultAzureCredential (Azure#12689)
  Add better autolockrenew on-failure handling capabilities. (Azure#12307)
  Update CODEOWNERS (Azure#12418)
  close client session in async tests (Azure#12656)
  Sync eng/common directory with azure-sdk-tools repository (Azure#12502)
  [Event Hubs] Use EventHubManagementClient to create test resources (Azure#12501)
  Increment package version after release of azure_identity (Azure#12675)
  [formrecognizer] include error code for errors that occur during polling (Azure#12621)
  Cross-language consistency changes (Azure#12669)
  Enable APIStubGen step (Azure#12615)
  Adding the ability to create a container with analytical storage turned on. (Azure#12408)
  [ServiceBus] Adjust user-agent following the guideline (Azure#12596)
  Release for Cognitive Services - Anomaly Detector (Azure#12582)
  [formrecognizer] Add type to FormField (Azure#12561)
  Add example summary for azure-identity readme.md (Azure#12509)
  ...
openapi-sdkautomation bot pushed a commit to AzureSDKAutomation/azure-sdk-for-python that referenced this pull request Feb 3, 2021
APIM Missing Operations reported in S360 (Azure#12621)

* missing operations

* swagger linter issues

* suppression

* add count property

* fix swagger model issues
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Client This issue points to a problem in the data-plane of the library. Cognitive - Form Recognizer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants