LocalSolver logo
is now
Hexaly logo

We're excited to share that we are moving forward. We're leaving behind the LocalSolver brand and transitioning to our new identity: Hexaly. This represents a leap forward in our mission to enable every organization to make better decisions faster when faced with operational and strategic challenges.


LSException Class

class LSException

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

Summary

Functions

LSException

Constructor.

~LSException

Destructor.

getFileName

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

getLineNumber

Gets the line number in the LocalSolver 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

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.

LSException::~LSException()

Destructor.

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

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

Returns:

File name.

int LSException::getLineNumber() const

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

Returns:

Line number.

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

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

Returns:

Function name.

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

Gets the explanation about the exception.

Returns:

Explanation.

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

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

Returns:

Exception message.

LSErrorCode LSException::getErrorCode() const

Returns the error code associated to this exception.

Returns:

Error code.

const char *LSException::what() const

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

Returns:

Exception message.

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

Same as getMessage().