Added missing code contract in domainerror