Updated NFCPassportReaderError.InvalidResponse to provide more information regarding the datagroup and the read tag
Added a new error case Unknown(Error) to handle errors not directly handled by the SDK
Added tests to cover the improved output
dataGroupType is now a computed property. This change makes it readonly and also available when an error needs to be thrown in parse method
Fixed an issue in PassportReader by removing nfcContinuation calls here as this is called in invalidateSession
Background
We experienced problems in capturing which datagroups were responsible for InvalidResponse errors. To deal with this the datagroup together with expected and actual tag information is returned back.
⚠️ Breaking changes
Errors that occur in PassportReader.readDataGroup(tagReader: TagReader, dgId: DataGroupId) will now be rethrown instead of being ignored. This is necessary in order to return the error back to the SDK consumer. Personally I think it's better to fail than to return successfully w/o any data, but there might be cases were this is not a good idea.
Changes
NFCPassportReaderError.InvalidResponse
to provide more information regarding the datagroup and the read tagUnknown(Error)
to handle errors not directly handled by the SDKdataGroupType
is now a computed property. This change makes it readonly and also available when an error needs to be thrown inparse
methodPassportReader
by removingnfcContinuation
calls here as this is called ininvalidateSession
Background
We experienced problems in capturing which datagroups were responsible for
InvalidResponse
errors. To deal with this the datagroup together with expected and actual tag information is returned back.⚠️ Breaking changes
PassportReader.readDataGroup(tagReader: TagReader, dgId: DataGroupId)
will now be rethrown instead of being ignored. This is necessary in order to return the error back to the SDK consumer. Personally I think it's better to fail than to return successfully w/o any data, but there might be cases were this is not a good idea.Resolves #54