Default Constructor on exceptions not recognised

Issue #1328 new
Justin Julicher created an issue

When you have an exception:

public class MyException extends Exception {
      public Integer statusCode {get; set;}
      public String message {get; set;}
      public MyException(Integer statusCode, String message){
          this.statusCode = statusCode;
          this.message = message;
      }
}

you can call this exception with just:

throw new MyException('My Message');

However, in IC it’s saying this is invalid although this compiles and saves.

Comments (1)

  1. Scott Wells repo owner

    I could swear that I implemented some special handling for this given how Apex Exception constructors behave. I'll take a look...

  2. Log in to comment