Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tracking delegate and improve error handling #234

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

mikahautz-mohemian
Copy link

Tracking Delegate

Add a tracking delegate for the PassportReader to track the detection of an NFC tag and the authentication processes (BAC and PACE).
We added the tracking to gain insights into the duration of each step, depending on its completion status (success or failure).

Note: There are no breaking changes, since the default implementation of the tracking delegate in the PassportReader is empty.

Error Handling

Add more detailed error handling to provide users better feedback on why the reading failed.

  • Add TimeOutError when the reader session timed out
  • Handle errors properly when the connection to a tag is lost during reading by throwing a ConnectionError instead of Unknown

laurageiger-mohemian and others added 5 commits October 16, 2024 08:28
[NFC-386] Add changes requested in PR
* [NFC-395] Add delegate for tracking NFC detection

* NFC-395 Changes requested in PR

* NFC-395 Add changes requested in PR
* Add more tracking for chip access phase

* Bubble up parsed card access instad of raw data
Copy link

@josiprezic-mohemian josiprezic-mohemian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left one suggestion regarding empty lines, but besides that, looks good to me ✅

Comment on lines +290 to +300
do {
trackingDelegate?.bacStarted()

try await doBACAuthentication(tagReader : tagReader)

trackingDelegate?.bacSucceeded()
} catch {
trackingDelegate?.bacFailed()

throw error
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider removing empty lines here

Suggested change
do {
trackingDelegate?.bacStarted()
try await doBACAuthentication(tagReader : tagReader)
trackingDelegate?.bacSucceeded()
} catch {
trackingDelegate?.bacFailed()
throw error
}
do {
trackingDelegate?.bacStarted()
try await doBACAuthentication(tagReader : tagReader)
trackingDelegate?.bacSucceeded()
} catch {
trackingDelegate?.bacFailed()
throw error
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants