pquintero commited on
Commit
845443f
·
1 Parent(s): 25c631c

catch unexpected error

Browse files
Files changed (1) hide show
  1. validation.py +2 -0
validation.py CHANGED
@@ -42,6 +42,8 @@ def validate_csv_can_be_read(file_content: str) -> pd.DataFrame:
42
  "Your file appears to have an unsupported encoding.<br>"
43
  "Please save your CSV file with UTF-8 encoding and try again."
44
  )
 
 
45
 
46
 
47
  def validate_dataframe(df: pd.DataFrame) -> None:
 
42
  "Your file appears to have an unsupported encoding.<br>"
43
  "Please save your CSV file with UTF-8 encoding and try again."
44
  )
45
+ except Exception as e:
46
+ raise gr.Error(f"❌ Unexpected error reading CSV file: {str(e)}")
47
 
48
 
49
  def validate_dataframe(df: pd.DataFrame) -> None: