You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

error.py 2.3KB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. from libs.exception import BaseHTTPException
  2. class DatasetNotInitializedError(BaseHTTPException):
  3. error_code = "dataset_not_initialized"
  4. description = "The dataset is still being initialized or indexing. Please wait a moment."
  5. code = 400
  6. class ArchivedDocumentImmutableError(BaseHTTPException):
  7. error_code = "archived_document_immutable"
  8. description = "The archived document is not editable."
  9. code = 403
  10. class DatasetNameDuplicateError(BaseHTTPException):
  11. error_code = "dataset_name_duplicate"
  12. description = "The dataset name already exists. Please modify your dataset name."
  13. code = 409
  14. class InvalidActionError(BaseHTTPException):
  15. error_code = "invalid_action"
  16. description = "Invalid action."
  17. code = 400
  18. class DocumentAlreadyFinishedError(BaseHTTPException):
  19. error_code = "document_already_finished"
  20. description = "The document has been processed. Please refresh the page or go to the document details."
  21. code = 400
  22. class DocumentIndexingError(BaseHTTPException):
  23. error_code = "document_indexing"
  24. description = "The document is being processed and cannot be edited."
  25. code = 400
  26. class InvalidMetadataError(BaseHTTPException):
  27. error_code = "invalid_metadata"
  28. description = "The metadata content is incorrect. Please check and verify."
  29. code = 400
  30. class WebsiteCrawlError(BaseHTTPException):
  31. error_code = "crawl_failed"
  32. description = "{message}"
  33. code = 500
  34. class DatasetInUseError(BaseHTTPException):
  35. error_code = "dataset_in_use"
  36. description = "The dataset is being used by some apps. Please remove the dataset from the apps before deleting it."
  37. code = 409
  38. class IndexingEstimateError(BaseHTTPException):
  39. error_code = "indexing_estimate_error"
  40. description = "Knowledge indexing estimate failed: {message}"
  41. code = 500
  42. class ChildChunkIndexingError(BaseHTTPException):
  43. error_code = "child_chunk_indexing_error"
  44. description = "Create child chunk index failed: {message}"
  45. code = 500
  46. class ChildChunkDeleteIndexError(BaseHTTPException):
  47. error_code = "child_chunk_delete_index_error"
  48. description = "Delete child chunk index failed: {message}"
  49. code = 500
  50. class PipelineNotFoundError(BaseHTTPException):
  51. error_code = "pipeline_not_found"
  52. description = "Pipeline not found."
  53. code = 404