James McCool commited on
Commit
cff79f7
·
1 Parent(s): a11ceac

Improve error handling for contest file export feedback in app.py

Browse files

- Added a try-except block to handle potential errors when displaying return messages, ensuring that the application remains stable even if an error occurs.
- This enhancement improves user experience by preventing crashes and maintaining the display of contest data.

Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -182,8 +182,10 @@ with tab1:
182
  if st.button('Send file to Database?', key='export_contest_file'):
183
  return_message = export_contest_file(db, sport_select, type_var, date_select, contest_id_map[contest_name_var], st.session_state['Contest_file'])
184
  with message_col:
185
- if return_message is not None:
186
  st.info(return_message)
 
 
187
  st.dataframe(st.session_state['Contest'].head(100))
188
 
189
  if 'Contest_file' in st.session_state:
 
182
  if st.button('Send file to Database?', key='export_contest_file'):
183
  return_message = export_contest_file(db, sport_select, type_var, date_select, contest_id_map[contest_name_var], st.session_state['Contest_file'])
184
  with message_col:
185
+ try:
186
  st.info(return_message)
187
+ except:
188
+ pass
189
  st.dataframe(st.session_state['Contest'].head(100))
190
 
191
  if 'Contest_file' in st.session_state: