mirror of
https://github.com/langgenius/dify.git
synced 2025-11-10 00:11:30 +00:00
Signed-off-by: -LAN- <laipz8200@outlook.com> Co-authored-by: twwu <twwu@dify.ai> Co-authored-by: crazywoola <100913391+crazywoola@users.noreply.github.com> Co-authored-by: jyong <718720800@qq.com> Co-authored-by: Wu Tianwei <30284043+WTW0313@users.noreply.github.com> Co-authored-by: QuantumGhost <obelisk.reg+git@gmail.com> Co-authored-by: lyzno1 <yuanyouhuilyz@gmail.com> Co-authored-by: quicksand <quicksandzn@gmail.com> Co-authored-by: Jyong <76649700+JohnJyong@users.noreply.github.com> Co-authored-by: lyzno1 <92089059+lyzno1@users.noreply.github.com> Co-authored-by: zxhlyh <jasonapring2015@outlook.com> Co-authored-by: Yongtao Huang <yongtaoh2022@gmail.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Joel <iamjoel007@gmail.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: nite-knite <nkCoding@gmail.com> Co-authored-by: Hanqing Zhao <sherry9277@gmail.com> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Co-authored-by: Harry <xh001x@hotmail.com>
80 lines
2.3 KiB
Python
80 lines
2.3 KiB
Python
from libs.exception import BaseHTTPException
|
|
|
|
|
|
class DatasetNotInitializedError(BaseHTTPException):
|
|
error_code = "dataset_not_initialized"
|
|
description = "The dataset is still being initialized or indexing. Please wait a moment."
|
|
code = 400
|
|
|
|
|
|
class ArchivedDocumentImmutableError(BaseHTTPException):
|
|
error_code = "archived_document_immutable"
|
|
description = "The archived document is not editable."
|
|
code = 403
|
|
|
|
|
|
class DatasetNameDuplicateError(BaseHTTPException):
|
|
error_code = "dataset_name_duplicate"
|
|
description = "The dataset name already exists. Please modify your dataset name."
|
|
code = 409
|
|
|
|
|
|
class InvalidActionError(BaseHTTPException):
|
|
error_code = "invalid_action"
|
|
description = "Invalid action."
|
|
code = 400
|
|
|
|
|
|
class DocumentAlreadyFinishedError(BaseHTTPException):
|
|
error_code = "document_already_finished"
|
|
description = "The document has been processed. Please refresh the page or go to the document details."
|
|
code = 400
|
|
|
|
|
|
class DocumentIndexingError(BaseHTTPException):
|
|
error_code = "document_indexing"
|
|
description = "The document is being processed and cannot be edited."
|
|
code = 400
|
|
|
|
|
|
class InvalidMetadataError(BaseHTTPException):
|
|
error_code = "invalid_metadata"
|
|
description = "The metadata content is incorrect. Please check and verify."
|
|
code = 400
|
|
|
|
|
|
class WebsiteCrawlError(BaseHTTPException):
|
|
error_code = "crawl_failed"
|
|
description = "{message}"
|
|
code = 500
|
|
|
|
|
|
class DatasetInUseError(BaseHTTPException):
|
|
error_code = "dataset_in_use"
|
|
description = "The dataset is being used by some apps. Please remove the dataset from the apps before deleting it."
|
|
code = 409
|
|
|
|
|
|
class IndexingEstimateError(BaseHTTPException):
|
|
error_code = "indexing_estimate_error"
|
|
description = "Knowledge indexing estimate failed: {message}"
|
|
code = 500
|
|
|
|
|
|
class ChildChunkIndexingError(BaseHTTPException):
|
|
error_code = "child_chunk_indexing_error"
|
|
description = "Create child chunk index failed: {message}"
|
|
code = 500
|
|
|
|
|
|
class ChildChunkDeleteIndexError(BaseHTTPException):
|
|
error_code = "child_chunk_delete_index_error"
|
|
description = "Delete child chunk index failed: {message}"
|
|
code = 500
|
|
|
|
|
|
class PipelineNotFoundError(BaseHTTPException):
|
|
error_code = "pipeline_not_found"
|
|
description = "Pipeline not found."
|
|
code = 404
|