Handling errors in Vision OCR
Vision OCR returns three classes of errors:
- Request error.
- File processing error.
- Errors occurring while performing a specific type of analysis.
This section lists possible errors and provides descriptions for each of these levels.
Request error
An error returned by Yandex Cloud if the requested operation fails. For error codes and descriptions, see the API concepts.
File processing error
An error that occurs when the service could not process one of the submitted files, for example, when decoding an image:
{
"results": [
{
"error": {
"code": 3,
"message": "Can't decode Image"
}
},
{
"results": [{ ... }] // Analysis results for a different file
}
]
}
For file processing errors, the gRPC error code is always 3, and the error cause is specified in message. Here are some examples:
- Image cannot be decoded.
- Image is too big.
- Image resolution is too high.
- Error while converting to JPEG.
Analysis error
This error occurs if the service failed to analyze the file for a requested Feature. for instance, it was unable to recognize text due to the wrong configuration:
{
"results": [
{
"results": [
{
"error": {
"code": 3,
"message": "Incorrect feature configuration: Incorrect number of language codes: 0"
}
}
]
},
{
"results": [{ ... }] // Analysis results for a different file
}
]
}
The possible errors include:
| Error code | Error description |
|---|---|
| 3 | Invalid request arguments. For example, the configuration specifies the wrong number of languages. |
| 8 | The quota for the requested feature has been exceeded. |
| 13 | Internal server error. This error indicates that the operation cannot be completed due to a server-side issue, e.g., insufficient computing resources. |
Was the article helpful?
Previous