Package org.netxms.client
Class NXCException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- org.netxms.client.NXCException
-
- All Implemented Interfaces:
Serializable
public class NXCException extends Exception
NetXMS client library exception. Used to report API call errors.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected StringadditionalInfoAdditional information about this errorprotected interrorCodeApplication-specific error code
-
Constructor Summary
Constructors Constructor Description NXCException(int errorCode)Create new NXC exception.NXCException(int errorCode, String additionalInfo)Create new NXC exception with additional information.NXCException(int errorCode, Throwable cause)Create new NXC exception with root cause reference.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetAdditionalInfo()Get additional information associated with exception (for example, NXSL error message)intgetErrorCode()Get exception's error code.protected StringgetErrorMessage(int code, String lang)Get error message text for given error code.StringgetLocalizedMessage()StringgetMessage()-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Field Detail
-
errorCode
protected int errorCode
Application-specific error code
-
additionalInfo
protected String additionalInfo
Additional information about this error
-
-
Constructor Detail
-
NXCException
public NXCException(int errorCode)
Create new NXC exception.- Parameters:
errorCode- Error code
-
NXCException
public NXCException(int errorCode, String additionalInfo)Create new NXC exception with additional information.- Parameters:
errorCode- Error codeadditionalInfo- Additional info
-
NXCException
public NXCException(int errorCode, Throwable cause)Create new NXC exception with root cause reference.- Parameters:
errorCode- Error codecause- root cause exception
-
-
Method Detail
-
getErrorMessage
protected String getErrorMessage(int code, String lang)
Get error message text for given error code. Must not return null.- Parameters:
code- error codelang- language code- Returns:
- error message for given code
-
getErrorCode
public int getErrorCode()
Get exception's error code.- Returns:
- the errorCode
-
getAdditionalInfo
public String getAdditionalInfo()
Get additional information associated with exception (for example, NXSL error message)- Returns:
- additional information associated with exception
-
getMessage
public String getMessage()
- Overrides:
getMessagein classThrowable
-
getLocalizedMessage
public String getLocalizedMessage()
- Overrides:
getLocalizedMessagein classThrowable
-
-