mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 12:55:00 +00:00
@@ -1,4 +1,5 @@
|
||||
import { STATUS_CODES } from 'node:http';
|
||||
import { escape } from 'node:querystring';
|
||||
|
||||
import { HttpStatus, Logger } from '@nestjs/common';
|
||||
import { ClsServiceManager } from 'nestjs-cls';
|
||||
@@ -605,6 +606,29 @@ export const USER_FRIENDLY_ERRORS = {
|
||||
message: ({ provider, kind, message }) =>
|
||||
`Provider ${provider} failed with ${kind} error: ${message || 'unknown'}`,
|
||||
},
|
||||
copilot_invalid_context: {
|
||||
type: 'invalid_input',
|
||||
args: { contextId: 'string' },
|
||||
message: ({ contextId }) => `Invalid copilot context ${contextId}.`,
|
||||
},
|
||||
copilot_context_file_not_supported: {
|
||||
type: 'bad_request',
|
||||
args: { fileName: 'string', message: 'string' },
|
||||
message: ({ fileName, message }) =>
|
||||
`File ${fileName} is not supported to use as context: ${message}`,
|
||||
},
|
||||
copilot_failed_to_modify_context: {
|
||||
type: 'internal_server_error',
|
||||
args: { contextId: 'string', message: 'string' },
|
||||
message: ({ contextId, message }) =>
|
||||
`Failed to modify context ${contextId}: ${message}`,
|
||||
},
|
||||
copilot_failed_to_match_context: {
|
||||
type: 'internal_server_error',
|
||||
args: { contextId: 'string', content: 'string', message: 'string' },
|
||||
message: ({ contextId, content, message }) =>
|
||||
`Failed to match context ${contextId} with "${escape(content)}": ${message}`,
|
||||
},
|
||||
|
||||
// Quota & Limit errors
|
||||
blob_quota_exceeded: {
|
||||
|
||||
Reference in New Issue
Block a user