package lava.net.mmp; import java.io.IOException; /** * **/ public class MMPException extends IOException { /** * **/ public final static int NO_ERROR_CODE_GIVEN = 0; /** * **/ private final static String[] errorString = {// "no specific error given",// }; /** * **/ private int errorCode = NO_ERROR_CODE_GIVEN; /** * **/ public MMPException() { super(); } /** * **/ public MMPException(int errorCode) { super(errorToString(errorCode)); this.errorCode = errorCode; } /** * **/ public MMPException(String error) { super(error); } /** * **/ public int getErrorCode() { return errorCode; } /** * **/ public static String errorToString(int errorCode) { try { return errorString[errorCode]; } catch(ArrayIndexOutOfBoundsException e) { return errorString[0]; } } }