Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Igor Kletsov
7,556 PointsWhat wrong?
Challenge Task 2. Add a constructor to TooBigException that accepts a string for the exception message.
what is missing?
namespace Treehouse.CodeChallenges
{
class TooBigException: System.Exception
{
public TooBigException (string message)
{
}
}
}
8 Answers

Jeremy McLain
Treehouse Guest TeacherMy apologies. I'm just now taking a look at this. This wasn't a compiler error. C# has very few requirements regarding spaces. The problem was in our test code.
Also, Igor is missing the call to the base constructor, so his code will still fail the challenge, but with a better error now.

Jeremy Hill
29,567 PointsThis just passed the challenge:
namespace Treehouse.CodeChallenges
{
class TooBigException: System.Exception{
public TooBigException(string message)
: base(message)
{
}
}
}

Igor Kletsov
7,556 PointsYour code works, my no. what is the difference ?
namespace Treehouse.CodeChallenges
{
class TooBigException : System.Exception
{
public TooBigException (string message) : base (message)
{
}
}
}

Jeremy Hill
29,567 PointsDo you see that space between TooBigException and your parameters? Try deleting that space, I bet that will fix it.

Igor Kletsov
7,556 PointsThank you, you're right. I spent two hours on it. I hate those bugs.

Michele Morison
13,407 PointsThis worked for me!
namespace Treehouse.CodeChallenges { class TooBigException : System.Exception { public TooBigException() { } } }

Jeremy Hill
29,567 Pointspublic TooBigException(string message)
: base(message)
{
}

Igor Kletsov
7,556 PointsI tried, does not work

Jeremy Hill
29,567 PointsYou're welcome, yeah those compilers can be picky sometimes.

Quanhu LEE
665 Pointsnamespace Treehouse.CodeChallenges { class TooBigException: System.Exception //Exception is in System namespace { } }

HIDAYATULLAH ARGHANDABI
21,017 Pointsthe correct answer is
namespace Treehouse.CodeChallenges
{
class TooBigException : System.Exception
{
}
}
rakesh prasad
505 Pointsrakesh prasad
505 Pointsnamespace Treehouse.CodeChallenges { class TooBigException : System.Exception { public TooBigException() {
}