Package org.netxms.client
Class NXCException
java.lang.Object
java.lang.Throwable
java.lang.Exception
org.netxms.client.NXCException
- All Implemented Interfaces:
Serializable
NetXMS client library exception. Used to report API call errors.
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprotected String
Additional information about this errorprotected int
Application-specific error codeprotected long[]
List of identifiers of any related objects (for example, objects referencing entity being deleted). -
Constructor Summary
ConstructorDescriptionNXCException
(int errorCode) Create new NXC exception.NXCException
(int errorCode, String additionalInfo) Create new NXC exception with additional information.NXCException
(int errorCode, String additionalInfo, long[] relatedObjects) Create new NXC exception with additional information.NXCException
(int errorCode, String additionalInfo, long[] relatedObjects, Throwable cause) Create new NXC exception with additional information and root cause reference.NXCException
(int errorCode, Throwable cause) Create new NXC exception with root cause reference. -
Method Summary
Modifier and TypeMethodDescriptionGet additional information associated with exception (for example, NXSL error message)int
Get exception's error code.protected String
getErrorMessage
(int code, String lang) Get error message text for given error code.long[]
Get list of identifiers of related objects.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Field Details
-
errorCode
protected int errorCodeApplication-specific error code -
additionalInfo
Additional information about this error
-
-
Constructor Details
-
NXCException
public NXCException(int errorCode) Create new NXC exception.- Parameters:
errorCode
- Error code
-
NXCException
Create new NXC exception with additional information.- Parameters:
errorCode
- Error codeadditionalInfo
- Additional info
-
NXCException
Create new NXC exception with additional information.- Parameters:
errorCode
- Error codeadditionalInfo
- Additional inforelatedObjects
- List of related object identifiers
-
NXCException
Create new NXC exception with root cause reference.- Parameters:
errorCode
- Error codecause
- root cause exception
-
NXCException
Create new NXC exception with additional information and root cause reference.- Parameters:
errorCode
- Error codeadditionalInfo
- Additional inforelatedObjects
- List of related object identifierscause
- root cause exception
-
-
Method Details
-
getErrorMessage
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
Get additional information associated with exception (for example, NXSL error message)- Returns:
- additional information associated with exception
-
getRelatedObjects
public long[] getRelatedObjects()Get list of identifiers of related objects.- Returns:
- list of identifiers of related objects or null if not provided
-
getMessage
- Overrides:
getMessage
in classThrowable
- See Also:
-
getLocalizedMessage
- Overrides:
getLocalizedMessage
in classThrowable
- See Also:
-