fix(server): convert 4xx status HttpError to UserFriendlyError (#10956)

This commit is contained in:
fengmk2
2025-03-18 09:28:50 +00:00
parent 5cb2abab76
commit 86c4e0705f
12 changed files with 78 additions and 6 deletions

View File

@@ -489,6 +489,7 @@ export type ErrorDataUnion =
| ExpectToRevokeDocUserRolesDataType
| ExpectToUpdateDocUserRoleDataType
| GraphqlBadRequestDataType
| HttpRequestErrorDataType
| InvalidEmailDataType
| InvalidHistoryTimestampDataType
| InvalidLicenseUpdateParamsDataType
@@ -569,6 +570,7 @@ export enum ErrorNames {
FAILED_TO_SAVE_UPDATES = 'FAILED_TO_SAVE_UPDATES',
FAILED_TO_UPSERT_SNAPSHOT = 'FAILED_TO_UPSERT_SNAPSHOT',
GRAPHQL_BAD_REQUEST = 'GRAPHQL_BAD_REQUEST',
HTTP_REQUEST_ERROR = 'HTTP_REQUEST_ERROR',
INTERNAL_SERVER_ERROR = 'INTERNAL_SERVER_ERROR',
INVALID_AUTH_STATE = 'INVALID_AUTH_STATE',
INVALID_CHECKOUT_PARAMETERS = 'INVALID_CHECKOUT_PARAMETERS',
@@ -697,6 +699,11 @@ export interface GraphqlBadRequestDataType {
message: Scalars['String']['output'];
}
export interface HttpRequestErrorDataType {
__typename?: 'HttpRequestErrorDataType';
message: Scalars['String']['output'];
}
export interface ImportUsersInput {
users: Array<CreateUserInput>;
}

View File

@@ -2,16 +2,16 @@
"ar": 96,
"ca": 4,
"da": 5,
"de": 97,
"de": 96,
"el-GR": 96,
"en": 100,
"es-AR": 97,
"es-AR": 96,
"es-CL": 98,
"es": 96,
"fa": 96,
"fr": 96,
"hi": 2,
"it-IT": 97,
"it-IT": 96,
"it": 1,
"ja": 96,
"ko": 61,

View File

@@ -7282,6 +7282,12 @@ export function useAFFiNEI18N(): {
code: string;
message: string;
}>): string;
/**
* `HTTP request error, message: {{message}}`
*/
["error.HTTP_REQUEST_ERROR"](options: {
readonly message: string;
}): string;
/**
* `Query is too long, max length is {{max}}.`
*/

View File

@@ -1813,6 +1813,7 @@
"error.NOT_FOUND": "Resource not found.",
"error.BAD_REQUEST": "Bad request.",
"error.GRAPHQL_BAD_REQUEST": "GraphQL bad request, code: {{code}}, {{message}}",
"error.HTTP_REQUEST_ERROR": "HTTP request error, message: {{message}}",
"error.QUERY_TOO_LONG": "Query is too long, max length is {{max}}.",
"error.VALIDATION_ERROR": "Validation error, errors: {{errors}}",
"error.USER_NOT_FOUND": "User not found.",