I made an exception to show what's the cause of error.
below is my code
public class DefaultException extends RuntimeException {
/**
* DefaultException
*/
private static final long serialVersionUID = 1L;
/**
* Constructor
* @param cause exception
*/
public DefaultException(Exception cause) {
super(cause) ;
}
/**
* Constructor
* @param cause error message
*/
public DefaultException(String message) {
super(message) ;
}
/**
* Constructor
* @param cause message, exception
*/
public DefaultException(String message, Throwable cause) {
super(message, cause) ;
}
}
Generating one of these constructors, specifying what's the error is successfully done.
But I want to return an error code additionally there.
It looks like...
public DefaultException(String message, String errorCode) {
super(message, errorCode) ;
}
But Throwable class doens't have that constructor, so this can't be acheived this way.
How can I do this?