|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--norsys.netica.NeticaError
A java.lang.Error that holds extra information when Netica reports an error for some attempted operation.
Field Summary | |
static int |
ERROR_ERR
Event occurred at "error" level - operation not properly finished, but no internal inconsistencies (e.g., user error, didn't finish process). |
static int |
FROM_DEVELOPER_CND
Your program indicated the error. |
static int |
FROM_WRAPPER_CND
The error did not occur within Netica itself, but in the JAVA API wrapper layer. |
static int |
INCONS_FINDING_CND
Inconsistent finding (only). |
static int |
NOTHING_ERR
Not anything (false alarm or "this is a test"). |
static int |
NOTICE_ERR
Notice of something unusual. |
static int |
OUT_OF_MEMORY_CND
System did not have enough memory to complete operation. |
static int |
REPORT_ERR
Not an error, but a report of success. |
static int |
USER_ABORTED_CND
User halted the function before it completed (not possible when using a Netica API version without the user interface) |
static int |
WARNING_ERR
Event occurred at "warning" level - safe to proceed (e.g., user error, recovered okay). |
static int |
XXX_ERR
Internal error, things left inconsistent - continuing could crash system. |
Method Summary | |
int |
getIdNumber()
Returns the ERROR_NUMBER identifying this error. |
java.lang.String |
getMessage()
Given a report of an error, this returns a message explaining the error. |
int |
getSeverity()
Returns the ERROR_SEVERITY level of this error (one of NOTHING_ERR, REPORT_ERR, NOTICE_ERR, WARNING_ERR, ERROR_ERR, or XXX_ERR). |
static java.util.Vector |
getWarnings(int severity)
Retrieve and clear (remove) all messages from the current default Environment that are below the severity level for generating a NeticaException. |
boolean |
isInCategory(int errcnd)
Returns a boolean to indicate whether this error was caused by the condition errcnd. |
java.lang.String |
toString()
Returns a readable string representation of this error. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int NOTHING_ERR
public static final int REPORT_ERR
public static final int NOTICE_ERR
public static final int WARNING_ERR
public static final int ERROR_ERR
public static final int XXX_ERR
public static final int OUT_OF_MEMORY_CND
public static final int USER_ABORTED_CND
public static final int FROM_WRAPPER_CND
public static final int FROM_DEVELOPER_CND
public static final int INCONS_FINDING_CND
Method Detail |
public int getIdNumber()
isInCategory | Returns a more general categorization of the error | |
getMessage | Returns a complete error message |
public int getSeverity()
This returns an indicator of how serious the error is.
These are some of the values, in order from least to most serious, that may be returned:
NOTHING_ERR | Not anything (nothing to report) | |
REPORT_ERR | Not an error, but a report of success | |
NOTICE_ERR | Notice of something unusual | |
WARNING_ERR | Event occurred at "warning" level - requested operation was completed, but results are suspect in some way | |
ERROR_ERR | Event occurred at "error" level - requested operation was not properly finished, but no internal inconsistencies resulted | |
XXX_ERR | Internal error, things left inconsistent - continuing could crash system |
If the severity is XXX_ERR, then the event causing it is the fault of Netica, and you should contact Norsys about it (support@norsys.com), but if it is any of the others, you should be able to change your software to remove any problems.
Version:
getIdNumber | Return the error's identification number | |
isInCategory | Return what kind of error it is |
public java.lang.String getMessage()
The message will start with the name of the Netica API function which was executing when the error occurred (the one you called, not any that are called internally), followed by a colon, and then a descriptive part. Generally the descriptive part is not just a generic message corresponding to the error number, but rather names the elements involved, and describes what went wrong.
Version:
getIdNumber | Returns the error's identification number | |
getSeverity | Returns how serious the error is | |
isInCategory | Returns what kind of error it is |
public boolean isInCategory(int errcnd)
This is to discover the reason behind an error which has occurred. It groups together errors into broad classes.
For errcnd pass one of the conditions below, and the return value will be true iff that was a cause of the error. Note that some errors could have more than one cause.
Possible values for errcnd are:
OUT_OF_MEMORY_CND | System did not have enough memory to complete operation | |
INCONS_FINDING_CND | Inconsistent finding (only) | |
USER_ABORTED_CND | User halted the function before it completed (not possible when using a Netica API version without the user interface) | |
FROM_DEVELOPER_CND | Your program indicated the error by constructing a NeticaException | |
FROM_WRAPPER_CND | Error occurred in a language specific converter for VB, JAVA, or C++, etc. |
getIdNumber | Return the error's identification number | |
getMessage | Return a complete error message | |
getSeverity | Return how serious the error is |
errcnd
- The ERROR_CATEGORY to be tested.public static java.util.Vector getWarnings(int severity) throws NeticaException
If there are no warnings at the given severity level or higher, null is returned.
The warnings that are returned are also removed from Netica. This means that subsequent calls to getWarnings will not return them.
Version:
Vector warnings = NeticaError.getWarnings( NeticaError.NOTICE_ERR); //clears all warnings node1.addLink( node2 ); node2.addLink( node1 ); warnings = NeticaError.getWarnings( NeticaError.WARNING_ERR); if ( warnings != null ){ System.err.println("Oops, created a cycle."); }Example #2:
Vector warnings = NeticaError.getWarnings( NeticaError.NOTICE_ERR); //clears all warnings net = new Net( file ); // a file read can generate warnings Vector warnings = NeticaError.getWarnings( NeticaError.WARNING_ERR ); if (warnings != null){ for( int w=0; w < warnings.size(); w++ ) { NeticaError ne = (NeticaError) warnings.get(w); System.err.println("*** WARNING *** : " + ne); } }
severity
- The level of errors and higher to retrieve; one of NOTHING_ERR, REPORT_ERR, NOTICE_ERR, or WARNING_ERR.public java.lang.String toString()
try { net.setName( "This name is illegal" ); } catch (NeticaException ne) { ne.printStackTrace(); } // would generate the following output. Note, a NeticaException's printStackTrace method // will call the toString() method of each NeticaError within it. ************** E R R O R *************** ** ErrorNumber = 5118 ** ErrorSeverity = ERROR_ERR ** ErrorCategory = ** ErrorMessage = SetNetName_bn: Name string passed is bad because 'This name is illegal' contains a space ******************************************
toString
in class java.lang.Object
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |