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 trial

C#

Donald Bell
Donald Bell
13,863 Points

C# Objects Custom Exceptions Challenge # 2 is not working. Is there a possible bug in this challenge?

C# Objects Custom Exceptions Challenge # 2 is not working. Is there a possible bug in this challenge? It says that it took too long.

3 Answers

Steven Parker
Steven Parker
229,644 Points

Taking too long is often a symptom of a loop that never finishes.

If you'd like some help with checking your code, show it here; or even better, make a snapshot of your workspace and post the link to it here.

It would also be helpful to post a link to the course page you are working with.

UPDATE: I don't know why this causes it to time out, but it looks like you just forgot to include the "public" access specifier on your constructor.

And for future issues, when posting code, use the instructions for code formatting in the Markdown Cheatsheet pop-up below the "Add an Answer" area. :arrow_heading_down:   Or watch this video on code formatting.

Donald Bell
Donald Bell
13,863 Points

https://teamtreehouse.com/library/c-objects/inheritance/custom-exceptions-2

namespace Treehouse.CodeChallenges { class TooBigException : System.Exception { TooBigException(string message) : base(message) {

    }
}

}

Donald Bell
Donald Bell
13,863 Points

There is no infinite loop involved in this code challenge.

Steven Parker
Steven Parker
229,644 Points

I agree, this time it's not a loop. And I updated my answer.

Donald Bell
Donald Bell
13,863 Points

I got it. I was missing a public access modifier.