DmitrMakeev commited on
Commit
384236f
·
verified ·
1 Parent(s): 1864fbf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -1
app.py CHANGED
@@ -695,7 +695,7 @@ def show_contacts():
695
  contacts = cursor.fetchall()
696
  conn.close()
697
 
698
- # HTML-шаблон для отображения таблицы
699
  html = '''
700
  <!doctype html>
701
  <html lang="en">
@@ -739,6 +739,11 @@ def show_contacts():
739
  '''
740
 
741
  return render_template_string(html, contacts=contacts)
 
 
 
 
 
742
  except Exception as e:
743
  print(f"Error showing contacts: {e}")
744
  return "Internal Server Error", 500
@@ -758,6 +763,7 @@ def show_contacts():
758
 
759
 
760
 
 
761
 
762
 
763
  if __name__ == '__main__':
 
695
  contacts = cursor.fetchall()
696
  conn.close()
697
 
698
+ # HTML template for displaying contacts table
699
  html = '''
700
  <!doctype html>
701
  <html lang="en">
 
739
  '''
740
 
741
  return render_template_string(html, contacts=contacts)
742
+
743
+ except sqlite3.Error as e:
744
+ print(f"SQLite error: {e}")
745
+ return "Database error. Please try again later.", 500
746
+
747
  except Exception as e:
748
  print(f"Error showing contacts: {e}")
749
  return "Internal Server Error", 500
 
763
 
764
 
765
 
766
+
767
 
768
 
769
  if __name__ == '__main__':