pszemraj commited on
Commit
3db06ee
1 Parent(s): 684bb04

add fancy error

Browse files

Signed-off-by: peter szemraj <peterszemraj@gmail.com>

Files changed (1) hide show
  1. app.py +7 -1
app.py CHANGED
@@ -79,7 +79,13 @@ def convert_PDF(
79
  file_path = Path(pdf_obj.name)
80
  if not file_path.suffix == ".pdf":
81
  logging.error(f"File {file_path} is not a PDF file")
82
- return "File is not a PDF file", None, None
 
 
 
 
 
 
83
  conversion_stats = convert_PDF_to_Text(
84
  file_path,
85
  ocr_model=ocr_model,
 
79
  file_path = Path(pdf_obj.name)
80
  if not file_path.suffix == ".pdf":
81
  logging.error(f"File {file_path} is not a PDF file")
82
+
83
+ html_error = f"""
84
+ <div style="color: red; font-size: 20px; font-weight: bold;">
85
+ File {file_path} is not a PDF file
86
+ </div>
87
+ """
88
+ return "File is not a PDF file", html_error, None
89
  conversion_stats = convert_PDF_to_Text(
90
  file_path,
91
  ocr_model=ocr_model,