catch unexpected error
Browse files- 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:
|