Open
Description
- @azure-rest/ai-translation-text:
- 1.0.0-beta.1:
- MacOS:
- nodejs
- 18.18.0:
- browser
- n/a:
- typescript
- 5.2.2:
- Is the bug related to documentation in
- README.md
- source code documentation
- SDK API docs on https://docs.microsoft.com
Describe the bug
Using TextTranslationClient, and receiving an error response. The response.body
returned by the client is a string. e.g. body: '{"error":{"code":401000,"message":"The request is not authorized because credentials are missing or invalid."}}'
but the type defined in @azure-rest/ai-translation-text/types/ai-translation-text.d.ts
is ErrorResponseOutput
which is an object containing error: ErrorDetailsOutput
.
To Reproduce
Steps to reproduce the behavior:
- Trigger any error using the TextTranslationClient
- Attempt to reference
res.body.error.message
- Get an error,
Uncaught TypeError: Cannot read properties of undefined (reading 'message')
Expected behavior
Either the response body is typed as a string, or the body is returned parsed as an object to match it's type definition.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Metadata
Assignees
Labels
This issue points to a problem in the data-plane of the library.Workflow: This issue is responsible by Azure service team.This issue requires a change to an existing behavior in the product in order to be resolved.Issues that are reported by GitHub users external to the Azure organization.Workflow: This issue needs attention from Azure service team or SDK team