[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 232
  • Last Modified:

Exception class

I'm really confused with this exception handling. So I'm trying to understand this stuff piece by piece. I have to create an exception class with a constructor whose receives a string which consists of an candy flavor and number of bars. This is what I have :

public class CandyBarException : ApplicationException
          private static string msg =
          public CandybarException (string flavor, int bar) :  base (msg)

Can one exception Have more than on message.

1 Solution
The exception cannot have more than one message since the constructor only accepts on string(message) as parameter

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now