-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
48 additions
and
9 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
packages/celest_auth/lib/src/platform/passkeys/passkey_exception_impl.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import 'package:celest_core/celest_core.dart'; | ||
|
||
// TODO(dnys1): Make sealed | ||
final class PasskeyExceptionImpl implements PasskeyException { | ||
const PasskeyExceptionImpl({required this.message}); | ||
|
||
@override | ||
final String message; | ||
|
||
@override | ||
String toString() => 'PasskeyException: $message'; | ||
} | ||
|
||
final class PasskeyCancellationException extends PasskeyExceptionImpl { | ||
const PasskeyCancellationException() | ||
: super(message: 'Passkey registration was canceled by the user'); | ||
} | ||
|
||
final class PasskeyUnknownException extends PasskeyExceptionImpl { | ||
const PasskeyUnknownException([String? message]) | ||
: super( | ||
message: message ?? | ||
'An unknown error occurred during passkey registration', | ||
); | ||
} | ||
|
||
final class PasskeyUnsupportedException extends PasskeyExceptionImpl { | ||
const PasskeyUnsupportedException() | ||
: super(message: 'Passkeys are not supported on this platform'); | ||
} | ||
|
||
final class PasskeyFailedException extends PasskeyExceptionImpl { | ||
const PasskeyFailedException([String? message]) | ||
: super(message: message ?? 'Passkey registration failed'); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters