[x] Read and follow the guides described in the documentation.
[x] Try to reproduce in our demo project.
[x] Search for your issue in the existing GitHub issues.
Bug Description
When an error on iOS occurs, the JSON response contains keys that are not parsed from the JSON response, resulting in empty error code/message.
Steps To Reproduce
Set wrong/unavailable processing scenario
Try to scan
Inspect the response JSON and the parsed error
{
"results" : {
},
"action" : 4,
"error" : {
"localizedDescription" : "Unavailable scenario, please check that your Core type and license support this scenario",
"code" : 2
}
}
final completion = DocumentReaderCompletion.fromJson(json.decode(data))!;
if (completion.error != null) {
final message = completion.error!.message; // null
final errorCode = completion.error!.errorCode; // null
}
Expected behavior
final completion = DocumentReaderCompletion.fromJson(json.decode(data))!;
if (completion.error != null) {
final message = completion.error!.message; // "Unavailable scenario, please check that your Core type and license support this scenario"
final errorCode = completion.error!.errorCode; // 2
}
Before Submitting, be sure to
Bug Description
When an error on iOS occurs, the JSON response contains keys that are not parsed from the JSON response, resulting in empty error code/message.
Steps To Reproduce
Expected behavior
Environment:
Additional context The
code
andlocalizedDescription
fields are not parsed here: https://github.com/regulaforensics/DocumentReader-Flutter/blob/master/lib/document_reader.dart#L1552