Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

errors.py 905B

12345678910111213141516171819202122232425262728293031323334353637
  1. from werkzeug.exceptions import HTTPException
  2. from libs.exception import BaseHTTPException
  3. class FilenameNotExistsError(HTTPException):
  4. code = 400
  5. description = "The specified filename does not exist."
  6. class RemoteFileUploadError(HTTPException):
  7. code = 400
  8. description = "Error uploading remote file."
  9. class FileTooLargeError(BaseHTTPException):
  10. error_code = "file_too_large"
  11. description = "File size exceeded. {message}"
  12. code = 413
  13. class UnsupportedFileTypeError(BaseHTTPException):
  14. error_code = "unsupported_file_type"
  15. description = "File type not allowed."
  16. code = 415
  17. class TooManyFilesError(BaseHTTPException):
  18. error_code = "too_many_files"
  19. description = "Only one file is allowed."
  20. code = 400
  21. class NoFileUploadedError(BaseHTTPException):
  22. error_code = "no_file_uploaded"
  23. description = "Please upload your file."
  24. code = 400