Errors
Service errors
Section titled “Service errors”Every ServerCall and Authentication call returns through a TechsignServiceListener. On failure onFailure(Exception e) is called; e can be one of these (com.techsign.rkyc.error):
| Error | HTTP | Meaning |
|---|---|---|
BadRequestException |
400 | Invalid request (e.g. a missing or wrong field) |
UnauthorizedException |
401 | Session invalid or expired |
ForbiddenException |
403 | Not allowed |
NotFoundException |
404 | Record not found |
InternalServerError |
500 | Server error |
ServerErrorException |
other 4xx/5xx | Other server errors |
Document detection
Section titled “Document detection”OcrListener.cardDetectionFailed(CardDetectionErrorsModel) tells you why the document could not be captured. Use it to guide the user:
| Field | When false |
|---|---|
isPredictionScoreEligible() |
The document could not be detected clearly |
isWidthHeightRatioEligible() |
The document is held at an angle |
isAreaRatioEligible() |
The document is too far or too close (getAreaErrorRatio()) |
isImageSharpnessRatioEligible() |
The image is blurry |
isHologramScoreEligible() |
Hologram glare |
getCardType() gives the detected document type; CardType.NO_CARD means there is no document in the frame.
In PassportReaderCallback.error(Exception e), when e is an NFCException, get the reason with ((NFCException) e).getNfcError():
| Error | Meaning | What to do |
|---|---|---|
InvalidMrzKey |
Serial number, date of birth or expiry date doesn’t match the document | Have the user confirm the details again |
ConnectionError |
The connection dropped | Try again |
AuthenticationFailed |
The document is too far from the phone | Remove the case, hold the document still and try again |
ActiveAuthNotSupportedForPassport |
The document doesn’t support active authentication | Read again without a nonce (null) |
InvalidTag |
The card read is not an ID document (e.g. a credit card) | Scan the right document |
UnknownError |
Unexpected error | See getCardServiceException() for details |