Handling errors in Vision OCR
Vision OCR returns errors for these three levels:
This section lists possible errors and provides descriptions for each of these levels.
Request error
A standard error returned by Yandex Cloud if an operation fails. For a list of error codes and descriptions, see the API concepts.
File processing error
An error that occurs if the service failed to process some of the files received. For example, if it failed to decode an image:
{
"results": [
{
"error": {
"code": 3,
"message": "Can't decode Image"
}
},
{
"results": [{ ... }] // Results of analyzing a different file.
}
]
}
In case of a file processing error, the gRPC error code will always be 3, and message will indicate the error cause. Here are some examples:
- Image cannot be decoded.
- Image too big.
- Image resolution too high.
- Error converting to JPEG.
Analysis error
This error occurs if the service failed to analyze the file for a requested Feature. For example, it failed to recognize text due to an incorrect configuration:
{
"results": [
{
"results": [
{
"error": {
"code": 3,
"message": "Incorrect feature configuration: Incorrect number of language codes: 0"
}
}
]
},
{
"results": [{ ... }] // Results of analyzing a different file.
}
]
}
The possible errors include:
| Error code | Error description |
|---|---|
| 3 | Invalid request parameters. For example, the configuration specifies an incorrect number of languages. |
| 8 | The limit for the given feature has been exceeded. |
| 13 | Internal server error. This error means that the operation cannot be performed due to a server-side technical problem, e.g., due to insufficient computing resources. |
Was the article helpful?
Previous
Next