Skip to content

Latest commit

 

History

History
146 lines (129 loc) · 16.1 KB

error-codes.md

File metadata and controls

146 lines (129 loc) · 16.1 KB

API 错误码参考 / API Error Code Reference

本文档由脚本生成,请勿手动编辑。修改语言文案或错误调用后运行: uv run python tests/tools/gen_error_code_doc.py > docs/guides/api/error-codes.md。

This document is generated by a script; do not edit it by hand. After changing locale strings or API error calls, run the command above.

HTTP API 错误码 / HTTP API error codes

HTTP 状态来自生产代码中的 ApiError(status, error_code) 调用。dynamic: status 表示该调用在运行时决定状态码。

error_code HTTP 状态 / HTTP status zh-CN 文案 en 文案
audit_calls_failed 500 获取调用记录失败: {error} Failed to retrieve API call records: {error}
audit_query_failed 500 查询失败: {error} The query failed: {error}
audit_stats_failed 500 获取统计信息失败: {error} Failed to retrieve statistics: {error}
authorization_token_invalid 401 授权令牌无效 The authorization token is invalid
authorization_token_malformed 401 授权令牌格式错误 The authorization token format is invalid
authorization_token_missing 401 未提供授权令牌 The authorization token is missing
caller_identity_missing 401 无法确定调用方身份 The caller identity could not be determined
invalid_history_source 400 source 仅支持 upload 或 url Source must be upload or url
invalid_history_status 422 status must be one of: success, failed, all status must be one of: success, failed, all
invalid_url 400 视频URL不能为空 The video URL is required
llm_queue_full 503 LLM 队列已满,请稍后重试{note} The LLM queue is full. Please try again later.{note}
notes_already_exists 400 详细笔记已存在,无需重复生成 Detailed notes already exist
notes_already_in_progress 409 详细笔记正在生成中,请等待当前任务完成 Detailed notes are already being generated
notes_chapters_required 409 详细笔记依赖已生成的章节层,请先生成章节后再重试 Generate chapters before requesting detailed notes
notes_creation_failed 500 创建详细笔记任务失败: {error} Failed to create the detailed notes task: {error}
notes_ownership_denied 403 无权对该任务生成详细笔记 You are not authorized to generate detailed notes for this task
notes_permission_denied 403 无生成详细笔记权限 You do not have permission to generate detailed notes
notes_queue_failed 500 详细笔记任务加入队列失败: {error}{note} Failed to queue the detailed notes task: {error}{note}
notes_status_unavailable 503 详细笔记任务状态查询失败,请稍后重试 The detailed notes task status is temporarily unavailable
notes_transcript_missing 400 缓存中没有转录数据,无法生成详细笔记 No transcript is available for detailed notes
ownership_check_unavailable 503 归属校验暂时不可用,请稍后重试 Task ownership could not be verified. Please try again later.
recalibration_creation_failed 500 创建重新校对任务失败: {error} Failed to create the recalibration task: {error}
recalibration_formatting_failed 500 重新校对任务转录数据格式化失败: {error}{note} Failed to format transcript data for recalibration: {error}{note}
recalibration_ownership_denied 403 无权对该任务发起重新校对 You are not authorized to recalibrate this task
recalibration_permission_denied 403 无重新校对权限 You do not have permission to recalibrate
recalibration_transcript_missing 400 缓存中没有转录数据,无法重新校对 No transcript is available for recalibration
resummary_creation_failed 500 创建重新生成总结任务失败: {error} Failed to create the summary regeneration task: {error}
resummary_formatting_failed 500 重新生成总结任务转录数据格式化失败: {error}{note} Failed to format transcript data for summary regeneration: {error}{note}
resummary_ownership_denied 403 无权对该任务发起重新生成总结 You are not authorized to regenerate the summary for this task
resummary_permission_denied 403 无重新生成总结权限 You do not have permission to regenerate summaries
resummary_transcript_missing 400 缓存中没有转录数据,无法重新生成总结 No transcript is available for summary regeneration
service_busy 503 service busy or lock unavailable, retry shortly Service busy or lock unavailable, retry shortly
service_unavailable 503 服务暂时不可用,请稍后重试 The service is temporarily unavailable. Please try again later.
summary_already_exists 400 总结已存在,无需重新生成 A summary already exists
summary_fetch_failed 500 获取摘要失败: {error} Failed to retrieve the summary: {error}
summary_ratio_failed 500 获取总结比例统计失败: {error} Failed to retrieve summary ratio statistics: {error}
summary_ratio_permission_denied 403 无权访问全局总结比例统计 You do not have permission to view global summary ratio statistics
task_access_denied 403 无权访问该任务 You are not authorized to access this task
task_capacity_reached 503 任务处理已达上限,请稍后重试 The task processing capacity has been reached. Please try again later.
task_id_not_found 404 任务不存在: {task_id} Task not found: {task_id}
task_not_found 404 任务不存在 Task not found
task_not_found_or_share_closed 404 任务不存在或分享已关闭 The task was not found or sharing has been disabled
task_queue_failed 500 任务加入队列失败: {error}{note} Failed to queue the task: {error}{note}
task_status_failed 500 获取任务状态失败: {error} Failed to retrieve the task status: {error}
transcript_not_found 404 未找到对应的转录数据 The corresponding transcript was not found
transcription_queue_full 503 任务队列已满,请稍后重试{note} The task queue is full. Please try again later.{note}
transcription_submission_failed 500 提交转录任务失败: {error} Failed to submit the transcription task: {error}
upload_acceptance_window_expired 410 上传幂等key已超过24小时受理截止时间 The upload idempotency key expired after the 24-hour acceptance window
upload_content_type 415 Content-Type必须为application/octet-stream Content-Type must be application/octet-stream
upload_declared_size 413 上传文件超过允许大小 The upload exceeds the allowed size
upload_declared_size_mismatch 400 实际上传字节与byte_size不一致 The received upload size does not match byte_size
upload_disabled_or_not_ready 503 上传接收未启用或worker尚未就绪 Upload receiving is disabled or the worker is not ready
upload_history_failed 500 上传历史查询失败: {error} Failed to retrieve upload history: {error}
upload_history_unavailable 503 上传历史查询失败 Upload history is temporarily unavailable
upload_idempotency dynamic: status 上传幂等请求无法受理:{detail} The upload idempotency request could not be accepted: {detail}
upload_idempotency_key 400 缺少Idempotency-Key The Idempotency-Key header is required
upload_inflight_limit 503 转录队列已满 The transcription queue is full
upload_metadata 400 上传元数据无效:{detail} Invalid upload metadata: {detail}
upload_not_accepted 409 尚未正式受理的上传没有分享可关闭 Sharing cannot be disabled before the upload is accepted
upload_observed_size_limit 413 实际上传字节超过声明或允许大小 The received upload exceeds the declared or allowed size
upload_queue_full 503 转录队列已满,上传未正式受理 The transcription queue is full; the upload was not accepted
upload_receipt_not_found 404 上传回执不存在 The upload receipt was not found
upload_receiver_limit 503 上传接收并发已满 The upload receiver concurrency limit has been reached
upload_record_not_found 404 上传记录不存在 The upload record was not found
upload_share_closed 404 上传分享不可用或已关闭 Upload sharing is unavailable or has been disabled
upload_share_unavailable 404 上传分享不可用 Upload sharing is unavailable
upload_temp_budget 507 上传临时存储预算或可用磁盘空间不足 The upload temporary storage budget or available disk space is insufficient
user_profile_failed 500 获取用户配置失败: {error} Failed to retrieve the user profile: {error}

任务失败原因 / Task failure reasons

GET /api/task/{task_id} 响应的 data.error 是失败文案文本(通常在失败写入时按服务端语言本地化;没有已存文案时使用当前语言的通用失败文案),不是 locale key;它可能随语言和失败内容变化,因此不稳定、不可用于客户端分支。表中 key 仅供对照文案,不是 API 返回值。

In GET /api/task/{task_id}, data.error contains failure text (normally localized with the server language when the failure is written; if no text was stored, it uses the generic failure text in the current language), not a locale key. It can vary with language and failure details, so it is unstable and must not be used for client branching. The keys in this table are for looking up the corresponding text only; they are not API response values.

key zh-CN 文案 en 文案
error.task_failure.calibrating_status_write_failed 任务状态写入异常: {error} Task status write failed: {error}
error.task_failure.capswriter_transcript_cache_save_failed 保存CapsWriter转录结果到缓存失败 Failed to save the CapsWriter transcript to cache
error.task_failure.download_file_failed 下载文件失败: {url} Download failed: {url}
error.task_failure.download_info_unavailable 无法获取下载信息: {url} Unable to retrieve download information: {url}
error.task_failure.funasr_transcript_cache_save_failed 保存FunASR转录结果到缓存失败 Failed to save the FunASR transcript to cache
error.task_failure.llm_executor_submit_failed 提交LLM任务失败: {error} Failed to submit the LLM task: {error}
error.task_failure.llm_handoff_queue_failed LLM任务加入队列失败: {error} Failed to enqueue the LLM task: {error}
error.task_failure.llm_processing_failed LLM处理失败: {error} LLM processing failed: {error}
error.task_failure.llm_submit_status_recovered LLM 任务提交失败,终态写入曾经失败,已由运行期维护补偿写入 An earlier LLM task submission failure was recovered by runtime maintenance
error.task_failure.local_upload_mapping_missing 本地上传的持久化准入记录或媒体映射缺失 Local upload durable admission or media mapping is missing
error.task_failure.media_admission_failed 媒体准入失败:{error} Media admission failed: {error}
error.task_failure.notes_queue_failed 详细笔记任务加入队列失败: {error} Detailed notes task queue submission failed: {error}
error.task_failure.notes_queue_rejected LLM 队列已满,详细笔记提交被拒绝 The LLM queue is full; detailed notes submission was rejected
error.task_failure.platform_subtitle_cache_save_failed 保存平台字幕到缓存失败 Failed to save the platform subtitles to cache
error.task_failure.recalibration_failed 重新校对失败: {error} Recalibration failed: {error}
error.task_failure.recalibration_input_formatting_failed 转录数据格式化失败: {error} Transcript formatting failed: {error}
error.task_failure.recalibration_queue_failed 任务加入队列失败: {error} Recalibration task queue submission failed: {error}
error.task_failure.recalibration_queue_rejected LLM 队列已满,重新校对提交被拒绝 The LLM queue is full; recalibration submission was rejected
error.task_failure.resummary_input_formatting_failed 转录数据格式化失败: {error} Transcript formatting failed: {error}
error.task_failure.resummary_queue_failed 任务加入队列失败: {error} Summary regeneration task queue submission failed: {error}
error.task_failure.resummary_queue_rejected LLM 队列已满,重新生成总结提交被拒绝 The LLM queue is full; summary regeneration submission was rejected
error.task_failure.transcription_failed {failure_label}转录任务失败: {error} {failure_label}Transcription task failed: {error}
error.task_failure.transcription_queue_failed 任务加入队列失败: {error} Transcription task queue submission failed: {error}
error.task_failure.transcription_queue_rejected 任务队列已满,提交被拒绝 The task queue is full; transcription submission was rejected
error.task_failure.transcription_submit_failed 提交任务失败: {error} Failed to submit the task: {error}
error.task_failure.upload_media_duration_limit 上传媒体超过允许时长,拒绝进入转录(media_duration_limit) Upload media exceeds the allowed duration; refusing transcription (media_duration_limit)
error.task_failure.upload_media_duration_unknown 上传媒体时长未知,拒绝进入转录(media_duration_unknown) Upload media duration is unknown; refusing transcription (media_duration_unknown)
error.task_failure.upload_processing_prefix UPLOAD_PROCESSING_FAILED: {reason} UPLOAD_PROCESSING_FAILED: {reason}
error.task_failure.upload_temp_budget_exceeded 上传转录产生的临时文件超过预算(upload_temp_budget) Upload transcription temporary files exceed the configured budget (upload_temp_budget)
error.task_failure.worker_unhandled_error {failure_label}转录任务异常: {error} {failure_label}Transcription worker failed: {error}
error.task_failure.youtube_api_failed YouTube API Server error: [{code}] {error} YouTube API Server error: [{code}] {error}
error.task_failure.youtube_api_unexpected YouTube API Server unexpected error: {error} YouTube API Server unexpected error: {error}
error.task_failure.youtube_subtitles_empty [youtube-api] subtitles are empty [youtube-api] subtitles are empty
error.task_failure.youtube_transcript_cache_save_failed [youtube-api] 转录结果保存到缓存失败 [youtube-api] Failed to save the transcription result to cache

其他本地化错误文案 / Other localized error strings

以下目录项用于任务状态中的通用失败文案或状态清理附注,不是 HTTP error_code。

These catalog entries are generic task-status failure text or status-cleanup notes, not HTTP error_code values.

locale key zh-CN 文案 en 文案
error.task_failed 任务处理失败 Task failed
error.terminal_write_note ;任务状态清理失败,task 可能短暂显示为处理中,系统将自动收敛 ; task status cleanup failed and may temporarily remain in processing

说明 / Notes

FastAPI 请求体校验产生的 422 响应保留默认形状,不含 error_code。应用处理器对其他 Starlette HTTP 错误可能附加 resource_not_found、method_not_allowed 或 api_error;这些框架错误保留原始 detail,不属于 locale 文案表。

FastAPI request-validation 422 responses keep their default shape and do not include error_code. The application handler may attach resource_not_found, method_not_allowed, or api_error to other Starlette HTTP errors; their original detail is preserved, so they are not locale strings listed above.