Catch errors in the Watchdog error handler

Fixes #164
Merge pull request #289 from d0ugal/error-handling

Catch errors in the Watchdog error handler