Skip to content

Commit 9897053

Browse files
committed
improved error handling
1 parent 3537717 commit 9897053

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

worldcities.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ def city(name=None):
4646
ibm_db.close(db2conn)
4747
return render_template('city.html', ci=rows)
4848
except:
49+
app.logger.error('could not establish Db2 connection')
50+
errorMsg = ibm_db.conn_errormsg()
51+
app.logger.error(errorMsg)
4952
return render_template('city.html', ci=[])
5053

5154

0 commit comments

Comments
 (0)