Possible Duplicate:
define your own exceptions with overloaded constructors in scala
I'd like to write an Scala exception class which sub-classes the Java Exception class, and provides similar constructors (each of which invokes the corresponding Exception ctor. I.e. how would I write the Scala equivalent of this Java class:
public class MyException extends java.lang.Exception {
public MyException () {
}
public MyException (String msg) {
super(msg);
}
public MyException (Throwable e) {
super(e);
}
public MyException (String msg, Throwable cause) {
super(msg, cause);
}
}
This appears to be related to this question however the answers therein aren't satisfactory (in that a sub-class isn't actually defined).