HxException Class

class HxException

HexalycOptimizer exception. If an error occurred, Hexaly Optimizer throws a specific exception which contains useful info for debugging purposes.

Summary

Functions

HxException

Constructor.

~HxException

Destructor.

getFileName

Gets the name of the Hexaly source file where the exception is thrown.

getLineNumber

Gets the line number in the Hexaly source file where the exception is thrown.

getFunctionName

Gets the name of the function where the exception is thrown.

getExplanation

Gets the explanation about the exception.

getMessage

Returns a string message with all useful info about the current exception.

getErrorCode

Returns the error code associated to this exception.

what

Returns a C-style string explanation about the current exception.

toString

Same as getMessage().

Functions

HxException::HxException(HxErrorCode errorCode, const std::string &fileName, int lineNumber, const std::string &functionName, const std::string &explanation)

Constructor.

Parameters:
  • errorCode – The code associated to this exception.

  • fileName – Name of the Hexaly source file where the exception is thrown.

  • lineNumber – Line number in the Hexaly source file where the exception is thrown.

  • functionName – Name of the function where the exception is thrown.

  • explanation – An explanation about the exception.

HxException::~HxException()

Destructor.

const std::string &HxException::getFileName() const

Gets the name of the Hexaly source file where the exception is thrown. Only useful for Hexaly’s maintenance team.

Returns:

File name.

int HxException::getLineNumber() const

Gets the line number in the Hexaly source file where the exception is thrown. Only useful for Hexaly’s maintenance team.

Returns:

Line number.

const std::string &HxException::getFunctionName() const

Gets the name of the function where the exception is thrown.

Returns:

Function name.

const std::string &HxException::getExplanation() const

Gets the explanation about the exception.

Returns:

Explanation.

const std::string &HxException::getMessage() const

Returns a string message with all useful info about the current exception.

Returns:

Exception message.

HxErrorCode HxException::getErrorCode() const

Returns the error code associated to this exception.

Returns:

Error code.

const char *HxException::what() const

Returns a C-style string explanation about the current exception.

Returns:

Exception message.

const std::string &HxException::toString() const

Same as getMessage().