Add handler for internal errors.