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

Manage Errors #12

Merged
merged 5 commits into from
May 3, 2024
Merged

Manage Errors #12

merged 5 commits into from
May 3, 2024

Conversation

lmuntaner
Copy link
Collaborator

@lmuntaner lmuntaner commented May 2, 2024

Motivation

Improve how the library manages errors and exposes them to users.

The main improvement is to differentiate technical erros, which will output at onError, from not getting a credential for other reasons, which go to onSuccess with a different outout.

Changes

  • Change onSuccess param type.
  • Check whether user closes the window without finishing flow. We consider this as a technical error and ends up in onError.
  • Changed currentFlows from a Set to a Map with the status of the current flow. Then the status is changed and checked during the flow.

Tests

  • Remove skipped test "calls onError with timeout error if flow doesn't start in five seconds". AuthClient doesn't manage it; therefore, I think that it makes sense we don't do it either.
  • Implement test "calls onError if user closes identity provider window".
  • Add a test "should not call onError when window closes after successful flow".
  • Change the test "calls onError when the credential fails" to check that it calls onSuccess.

@lmuntaner lmuntaner marked this pull request as ready for review May 2, 2024 15:06
Copy link

@frederikrothenberger frederikrothenberger left a comment

Choose a reason for hiding this comment

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

Makes sense, left a few minor comments. Thanks!

js-library/src/request-verifiable-presentation.ts Outdated Show resolved Hide resolved
js-library/src/request-verifiable-presentation.ts Outdated Show resolved Hide resolved
js-library/src/request-verifiable-presentation.ts Outdated Show resolved Hide resolved
@lmuntaner lmuntaner merged commit 2b06897 into main May 3, 2024
12 checks passed
@lmuntaner lmuntaner deleted the 05-02-manage_errors branch May 3, 2024 12:08
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.

2 participants