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# C# Objects Inheritance Custom Exceptions

C# Objects - Custom Exceptions - Coding Challenge Part 2 of 2

Hi,

I am running into an issue when I attempt to submit my code for this question. I am NOT getting the "bummer" can't compile message. I am getting an error box pop up informing me "Oh no! There is a temporary issue running this code...".

Is it because my code is broken?

I set the constructor per the instructions as in the attached code. I really appreciate any insight. I've tried to run it in 2 different browsers (Chrome and IE).

Thanks!!

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


    }

}

1 Answer

andren
andren
28,558 Points

Yes there is an issue with your code, though the error is not so big that it justifies making the challenge checker crash.

The issue is very simple, you forgot to add the public access modifier to the TooBigException constructor. Without expliclitly giving it an access level of public it defaults to private. And a private constructor is usually pretty useless since the main point of a constructor is to be used in other classes.

Thank you very much for your speedy reply. This worked perfectly, and it compiled successfully.