Add error auto-handling.