feat(core): track signin failed reason (#8746)

fix AF-1568
This commit is contained in:
forehalo
2024-11-08 10:34:15 +00:00
parent 02dbe135d4
commit 1a1041712f
4 changed files with 41 additions and 16 deletions

View File

@@ -12,14 +12,17 @@ export interface UserFriendlyErrorResponse {
stacktrace?: string;
}
export class UserFriendlyError implements UserFriendlyErrorResponse {
status = this.response.status;
code = this.response.code;
type = this.response.type;
name = this.response.name;
message = this.response.message;
args = this.response.args;
stacktrace = this.response.stacktrace;
export class UserFriendlyError
extends Error
implements UserFriendlyErrorResponse
{
readonly status = this.response.status;
readonly code = this.response.code;
readonly type = this.response.type;
override readonly name = this.response.name;
override readonly message = this.response.message;
readonly args = this.response.args;
readonly stacktrace = this.response.stacktrace;
static fromAnyError(response: any) {
if (response instanceof GraphQLError) {
@@ -51,7 +54,9 @@ export class UserFriendlyError implements UserFriendlyErrorResponse {
});
}
constructor(private readonly response: UserFriendlyErrorResponse) {}
constructor(private readonly response: UserFriendlyErrorResponse) {
super(response.message);
}
}
export class GraphQLError extends BaseGraphQLError {