Skip to content

Commit 9ab0c84

Browse files
committed
some error message cleanup
1 parent e1137de commit 9ab0c84

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

py-src/data_formulator/agents/agent_py_data_rec.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ def process_gpt_response(self, input_tables, messages, response):
173173
logger.warning('other error:')
174174
error_message = traceback.format_exc()
175175
logger.warning(error_message)
176-
result = {'status': 'other error', 'code': code_str, 'content': f"Unexpected error: {error_message}"}
176+
result = {'status': 'other error', 'code': code_str, 'content': f"Unexpected error executing the code, please try again."}
177177
else:
178178
result = {'status': 'error', 'code': "", 'content': "No code block found in the response. The model is unable to generate code to complete the task."}
179179

py-src/data_formulator/tables_routes.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,11 +391,12 @@ def upload_db_file():
391391

392392
except Exception as db_error:
393393
# Clean up temp file
394+
logger.error(f"Error uploading db file: {str(db_error)}")
394395
if os.path.exists(temp_db_path):
395396
os.remove(temp_db_path)
396397
return jsonify({
397398
"status": "error",
398-
"message": f"Invalid DuckDB database file: {str(db_error)}"
399+
"message": f"Invalid DuckDB database file."
399400
}), 400
400401

401402
return jsonify({

0 commit comments

Comments
 (0)