Expand error handling