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 error utils function for handling biometric errors #62

Closed
carmenlau opened this issue May 4, 2021 · 1 comment · Fixed by #63
Closed

Add error utils function for handling biometric errors #62

carmenlau opened this issue May 4, 2021 · 1 comment · Fixed by #63
Assignees
Projects

Comments

@carmenlau
Copy link
Contributor

Currently when encountering error in biometric api, we throw the original error from the native api to user. For user to handle the error more easily, we should provide utils function for user to identify errors, like what we did in js sdk.

https://github.com/authgear/authgear-sdk-js/blob/master/packages/authgear-react-native/src/error.ts#L82

@louischan-oursky
Copy link
Contributor

louischan-oursky commented May 11, 2021

Error representation on iOS

On iOS 14.5, NSError has a new property named underlyingErrors. Previously, there is no native way to wrap error.

Example of error representation in popular library: https://github.com/Alamofire/Alamofire/blob/master/Source/AFError.swift

Error representation on Android

Java's exception has getCause method since Java 1.4

Error representation on JavaScript

The builtin Error class does not support error wrapping.

Example: https://github.com/moment/luxon/blob/master/src/errors.js

Summary on error representation

Only Java supports error wrapping out of the box. If we want to introduce error wrapping to report underlying error, we have to introduce our own set of error classes.

@mr9dollars mr9dollars moved this from To do to focus on today in May 2021 May 11, 2021
@mr9dollars mr9dollars moved this from focus on today to In progress in May 2021 May 13, 2021
@louischan-oursky louischan-oursky moved this from In progress to Review in progress in May 2021 May 13, 2021
May 2021 automation moved this from Review in progress to Done May 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

2 participants