We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fe8694a commit 61ddd2eCopy full SHA for 61ddd2e
todo_app/app.py
@@ -16,6 +16,9 @@ def index():
16
@app.route('/add', methods=['POST'])
17
def add():
18
title = request.form.get('title')
19
+
20
+ app.logger.info(f'Adding new item: {title}')
21
22
add_mongo_item(title)
23
return redirect('/')
24
@@ -24,8 +27,15 @@ def update_status():
27
item_id = request.form.get('item_id')
25
28
status = request.form.get('status')
26
29
30
+ app.logger.info(f'Updating status of item {item_id} to {status}')
31
32
update_mongo_item_status(item_id, ItemStatus(status))
33
34
35
36
+ @app.errorhandler(Exception)
37
+ def handle_exception(e):
38
+ app.logger.info(f'Exception: {e}')
39
+ return e
40
41
return app
0 commit comments