NxLibException

This class encapsulates NxLib API errors. All overloaded functions of NxLibItem and NxLibCommand not taking a return code pointer will throw an NxLibException when the API return code indicates an error.

class NxLibException

Public Functions

NxLibException(std::string const &_itemPath, int _errorCode, std::shared_ptr<NxLibItemToken> _token = nullptr)

Parameters
  • _itemPath: The path to the tree node, which caused the exception.

  • _errorCode: The error code that occurred while accessing the node.

  • _token: An optional NxLibItemToken to keep the execution slot of an NxLibCommand alive while this exception instance exists.

int getErrorCode() const

The NxLib.

error code that caused this exception.

std::string const &getErrorText() const

The text description of the failure as returned by nxLibTranslateReturnCode().

std::string const &getItemPath() const

The path to the tree node on which the failed operation was attempted.

std::shared_ptr<NxLibItemToken> const &getToken() const

Token that holds an NxLibItem.