feat!: Add exception to onVerificationFailed callback#20
feat!: Add exception to onVerificationFailed callback#20
Conversation
06d5ee3 to
58df0c4
Compare
There was a problem hiding this comment.
Pull Request Overview
Adds propagation of SecReaderException to onVerificationFailed callbacks to improve error diagnostics and handling across SecWidget and SecModalBuilder.
- Passes exception details from lower layers to UI callbacks.
- Introduces SecResultFailed.exception and updates example, README, and tests to new signatures.
Reviewed Changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/src/ui/sec_widget.dart | Adds exception-typed onVerificationFailed and forwards exception; updates button handler and child callback wiring. |
| lib/src/ui/sec_modal.dart | Makes onVerificationFailed accept exception; adds SecResultFailed(exception) and forwards it through modal result. |
| lib/src/ui/scanning_view.dart | Forwards underlying exception to onVerificationFailed; updates button handler. |
| test/sec_widget_test.dart | Adjusts tests to new callback arity. |
| example/lib/main.dart | Updates example to log received exception; minor import reorder. |
| README.md | Documents the new exception parameter for onVerificationFailed. |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
1975d58 to
e562c72
Compare
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
ElectricCookie
left a comment
There was a problem hiding this comment.
Please add a test using virtual strategy to simulate the error being thrown and correctly passed back to the widget
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 47 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 47 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This PR enhances error handling by adding an optional
SecReaderExceptionparameter to theonVerificationFailedcallback inSecWidgetandSecModalBuilder. This provides developers with detailed information about why a verification process failed, enabling more specific error handling.Changes include:
onVerificationFailedcallback signature acrossSecWidget,SecModalBuilder, the example app, and tests.SecReaderExceptionfrom the underlying logic to the UI layer.README.mdto document the new callback parameter and explain its usage.Breaking Changes
All consumers must update their
onVerificationFailedcallback:Before:
After: