0

Within a NeuralNetwork class, I've defined the nested class

public class TrainSetCardinalityMismatch : ArgumentOutOfRangeException 

This is to be thrown when a user tries to provide a training set that does not have the same number of elements as the answer set, or vice-versa. So in the setter for the training set, I check to see if the number of elements matches the number of elements in the answer set, and if not, I put

throw new TrainSetCardinalityMismatch();

but it's giving me the error

NeuralNetwork.TrainSetCardinalityMismatch.TrainSetCardinalityMismatch()' is inaccessible due to its protection level

The trainingSet is also a field of the neuralnetwork class (which shouldn't matter since the error is public anyway), and don't think the ArgumentOutOfRangeException is private.

Does anyone have any ideas?

jazb
  • 5,498
  • 6
  • 37
  • 44
Tara
  • 389
  • 3
  • 14
  • How about your NeuralNetwork? I think it must be public in order to throw nested exception as compiler cannot know where it will be handled. – Piotr Wojsa Jan 08 '19 at 06:30

1 Answers1

0

ignore this question - I forgot to put an access modifier on the constructor...

Tara
  • 389
  • 3
  • 14
  • If you think your mistake would help somebody in future pls update your answer and add some code and explain completely. Otherwise, delete the question. Thanks – M.Armoun Jan 08 '19 at 06:55