UNPKG

@lobehub/ui

Version:

Lobe UI is an open-source UI component library for building AIGC web apps

1 lines 1.13 kB
{"version":3,"file":"error.mjs","names":[],"sources":["../../../src/chat/types/error.ts"],"sourcesContent":["/* eslint-disable sort-keys-fix/sort-keys-fix */\nexport const ChatErrorType = {\n // ******* 业务错误语义 ******* //\n\n InvalidAccessCode: 'InvalidAccessCode', // 密码无效\n OpenAIBizError: 'OpenAIBizError', // OpenAI 返回的业务错误\n NoAPIKey: 'NoAPIKey',\n\n // ******* 客户端错误 ******* //\n BadRequest: 400,\n Unauthorized: 401,\n Forbidden: 403,\n ContentNotFound: 404, // 没找到接口\n MethodNotAllowed: 405, // 不支持\n TooManyRequests: 429,\n\n // ******* 服务端错误 ******* //\n InternalServerError: 500,\n BadGateway: 502,\n ServiceUnavailable: 503,\n GatewayTimeout: 504,\n} as const;\n/* eslint-enable */\n\nexport type ErrorType = (typeof ChatErrorType)[keyof typeof ChatErrorType];\n\nexport interface ErrorResponse {\n body: any;\n errorType: ErrorType;\n}\n"],"mappings":";AACA,MAAa,gBAAgB;CAG3B,mBAAmB;CACnB,gBAAgB;CAChB,UAAU;CAGV,YAAY;CACZ,cAAc;CACd,WAAW;CACX,iBAAiB;CACjB,kBAAkB;CAClB,iBAAiB;CAGjB,qBAAqB;CACrB,YAAY;CACZ,oBAAoB;CACpB,gBAAgB;CACjB"}