function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
asapjimasapjim 

Developer Console cannot create Exception class

Hi, the Developer Console fails when you try to create a class with the word Exception in the class name.  Here's what I have done, clicked on Repository, clicked on Classes, Clicked the New button, entered the name of a class (MyException), Click OK, receive dialog that states New Class Error MyException: Exception class must extend another Exception class.

 

Is there a workaround for this?

 

Thanks,

sai.sfsai.sf

User-defined exception class names must end with the stringexception, such as “MyException”, “PurchaseException” and so on. All exception classes automatically extend the system-defined base classexception

.

 

please see below link for more info.

 

http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_classes_exception.htm

leemeisterleemeister
You have to create it using an ide or through Develop > Apex Classes > New in the setup menu. They should edit the Apex workbook to reflect this as its impossible to create it via the developer console.