package lava.net.psyc; import java.io.IOException; /** * **/ public class PSYCException 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 PSYCException() { super(); } /** * **/ public PSYCException(int errorCode) { super(errorToString(errorCode)); this.errorCode = errorCode; } /** * **/ public PSYCException(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]; } } }