Replace Contract.Requires<CustomException> with Contract.Requires.