Moved error handling to catches module