Class NXCException

All Implemented Interfaces:
Serializable

public class NXCException extends Exception
NetXMS client library exception. Used to report API call errors.
See Also:
  • Field Details

    • errorCode

      protected int errorCode
      Application-specific error code
    • additionalInfo

      protected String additionalInfo
      Additional information about this error
    • relatedObjects

      protected long[] relatedObjects
      List of identifiers of any related objects (for example, objects referencing entity being deleted).
  • Constructor Details

    • 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 code
      additionalInfo - Additional info
    • NXCException

      public NXCException(int errorCode, String additionalInfo, long[] relatedObjects)
      Create new NXC exception with additional information.
      Parameters:
      errorCode - Error code
      additionalInfo - Additional info
      relatedObjects - List of related object identifiers
    • NXCException

      public NXCException(int errorCode, Throwable cause)
      Create new NXC exception with root cause reference.
      Parameters:
      errorCode - Error code
      cause - root cause exception
    • NXCException

      public NXCException(int errorCode, String additionalInfo, long[] relatedObjects, Throwable cause)
      Create new NXC exception with additional information and root cause reference.
      Parameters:
      errorCode - Error code
      additionalInfo - Additional info
      relatedObjects - List of related object identifiers
      cause - root cause exception
  • Method Details

    • getErrorMessage

      protected String getErrorMessage(int code, String lang)
      Get error message text for given error code. Must not return null.
      Parameters:
      code - error code
      lang - 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
    • getRelatedObjects

      public long[] getRelatedObjects()
      Get list of identifiers of related objects.
      Returns:
      list of identifiers of related objects or null if not provided
    • getMessage

      public String getMessage()
      Overrides:
      getMessage in class Throwable
      See Also:
    • getLocalizedMessage

      public String getLocalizedMessage()
      Overrides:
      getLocalizedMessage in class Throwable
      See Also: