This page is for an old version of Hexaly Optimizer. We recommend that you update your version and read the documentation for the latest stable release.

LSException Class

class

LocalSolver exception.

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

Functions

localsolver::LSException::LSException(LSErrorCode 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 LocalSolver source file where the exception is thrown.
  • lineNumber - Line number in the LocalSolver source file where the exception is thrown.
  • functionName - Name of the function where the exception is thrown.
  • explanation - An explanation about the exception.

localsolver::LSException::~LSException()

Destructor.

const std::string &localsolver::LSException::getFileName()
const

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

Only useful for LocalSolver’s maintenance team.

Return:File name.

int localsolver::LSException::getLineNumber()
const

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

Only useful for LocalSolver’s maintenance team.

Return:Line number.

const std::string &localsolver::LSException::getFunctionName()
const

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

Return:Function name.

const std::string &localsolver::LSException::getExplanation()
const

Gets the explanation about the exception.

Return:Explanation.

const std::string &localsolver::LSException::getMessage()
const

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

Return:Exception message.

LSErrorCode localsolver::LSException::getErrorCode()
const

Returns the error code associated to this exception.

Return:Error code.

const char *localsolver::LSException::what()
const

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

Return:Exception message.

const std::string &localsolver::LSException::toString()
const

Same as getMessage().