Added error code parameter. Followed existing conventions.