-
Notifications
You must be signed in to change notification settings - Fork 145
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(core): kratos error handling (#4605)
- Loading branch information
Showing
19 changed files
with
187 additions
and
176 deletions.
There are no files selected for viewing
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
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,45 @@ | ||
import { AuthenticationError } from "@/domain/authentication/errors" | ||
import { ErrorLevel } from "@/domain/shared" | ||
|
||
export class KratosError extends AuthenticationError {} | ||
|
||
export class MissingSessionIdError extends KratosError { | ||
level = ErrorLevel.Critical | ||
} | ||
|
||
export class AuthenticationKratosError extends KratosError {} | ||
export class AuthorizationKratosError extends KratosError {} | ||
export class ExtendSessionKratosError extends KratosError {} | ||
export class InvalidIdentitySessionKratosError extends KratosError {} | ||
|
||
export class SessionRefreshRequiredError extends KratosError {} | ||
|
||
export class EmailAlreadyExistsError extends KratosError {} | ||
|
||
export class PhoneAccountAlreadyExistsError extends KratosError { | ||
level = ErrorLevel.Info | ||
} | ||
|
||
export class PhoneAccountAlreadyExistsNeedToSweepFundsError extends KratosError { | ||
level = ErrorLevel.Info | ||
} | ||
|
||
export class MissingCreatedAtKratosError extends KratosError { | ||
level = ErrorLevel.Critical | ||
} | ||
|
||
export class MissingExpiredAtKratosError extends KratosError { | ||
level = ErrorLevel.Critical | ||
} | ||
|
||
export class MissingTotpKratosError extends KratosError { | ||
level = ErrorLevel.Critical | ||
} | ||
|
||
export class IncompatibleSchemaUpgradeError extends KratosError {} | ||
|
||
export class CodeExpiredKratosError extends KratosError {} | ||
|
||
export class UnknownKratosError extends KratosError { | ||
level = ErrorLevel.Critical | ||
} |
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 @@ | ||
export * from "./errors" |
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 @@ | ||
type KratosError = import("./errors").KratosError |
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
Oops, something went wrong.