Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialNascent Noob
1,062 PointsValidation Fails
Trying to validate/pass the exercise for this quiz consistently fails when attempted from Windows or Android. Is my code so wrong it's breaking it or is there a bug?
namespace Treehouse.CodeChallenges
{
class TooBigException : System.Exception
{
TooBigException(string message) : base(message)
{
}
}
}
1 Answer
andren
28,558 PointsA bit of both. There is an issue with your code which is causing the crash, but normally the challenge checker is not meant to crash just because of an issue with the code it's testing, so that part is a bug.
The issue is that you have forgotten to declare the constructor as public
. If you don't declare an access modifier then by default C# will assign an access level of private
. A private
constructor is generally not very useful since the main purpose of a constructor is to be called from other classes.
If you add the public
keyword like this:
namespace Treehouse.CodeChallenges
{
class TooBigException : System.Exception
{
public TooBigException(string message) : base(message)
{
}
}
}
Then your code should work.
Nascent Noob
1,062 PointsNascent Noob
1,062 PointsThanks Andren. That makes a lot of sense.