# How to catch exceptions from database calls such as system.db.runPrepUpdate

**URL:** <https://forum.inductiveautomation.com/t/how-to-catch-exceptions-from-database-calls-such-as-system-db-runprepupdate/65248>\
**Category:** Ignition\
**Tags:** ignition81, scripting\
**Created:** [October 14, 2022, 7:41pm UTC](https://forum.inductiveautomation.com/t/how-to-catch-exceptions-from-database-calls-such-as-system-db-runprepupdate/65248 "2022-10-14T19:41:46Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [October 14, 2022, 7:57pm UTC](https://forum.inductiveautomation.com/t/how-to-catch-exceptions-from-database-calls-such-as-system-db-runprepupdate/65248/2 "2022-10-14T19:57:24Z")

</div>

See this topic:

> [@Generic Python error handler?](https://forum.inductiveautomation.com/t/generic-python-error-handler/60584):
>
> I’m trying to code a generic type of error handler that I can call from the except clauses from different scripts where the error\_handler procedure can take different routes depending on what is passed to it. Ideally, I want a generic error handler that will catch any/all types of errors. My question is, will the str(e) in the except clause below work correctly for all or most types of errors? try: i = 1 / 0 # divide by zero error except Exception as e: error\_handler(str(e)) # wil…

---

_[View the full topic](https://forum.inductiveautomation.com/t/how-to-catch-exceptions-from-database-calls-such-as-system-db-runprepupdate/65248)._
