![]() |
LibraryLink Utilities
3.0.1
Modern C++ wrapper over LibraryLink and WSTP
|
Class representing an exception in paclet code.
All exceptions that are thrown from paclet code should be of this class. To prevent users from overriding predefined LLU exceptions the constructor of LibraryLinkError class is private. Developers should use ErrorManager::throwException method to throw exceptions.
Inherits runtime_error.
#include <LibraryLinkError.h>
Public Types | |
| using | IdType = int |
| A type that holds error id numbers. More... | |
Public Member Functions | |
| LibraryLinkError (const LibraryLinkError &e) noexcept | |
| Copy-constructor. If there are any messages parameters on the WSLINK, a deep copy is performed. More... | |
| LibraryLinkError & | operator= (const LibraryLinkError &e) noexcept |
| Copy-assignment operator. More... | |
| LibraryLinkError (LibraryLinkError &&e) noexcept | |
Move-constructor. Steals messagesParams from e. More... | |
| LibraryLinkError & | operator= (LibraryLinkError &&e) noexcept |
| Move-assignment operator. More... | |
| ~LibraryLinkError () override | |
| The destructor closes the link that was used to send message parameters, if any. More... | |
| void | setDebugInfo (const std::string &dbg) |
| Set debug info. More... | |
| IdType | id () const noexcept |
| Get the value of error code. More... | |
| IdType | which () const noexcept |
| Alias for id() to preserve backwards compatibility. More... | |
| std::string | name () const noexcept |
| Get the value of error code. More... | |
| std::string | message () const noexcept |
| Get the value of error code. More... | |
| std::string | debug () const noexcept |
| Get debug info. More... | |
| template<typename... T> | |
| void | setMessageParameters (WolframLibraryData libData, T &&... params) |
| Store arbitrary number of message parameters in a List expression on a loopback link. More... | |
| IdType | sendParameters (WolframLibraryData libData, const std::string &WLSymbol=getExceptionDetailsSymbol()) const noexcept |
| Send parameters stored in the loopback link to top-level. More... | |
Static Public Member Functions | |
| static std::string | getExceptionDetailsSymbol () |
| Get symbol that will hold details of last thrown exception. More... | |
| static void | setExceptionDetailsSymbolContext (std::string newContext) |
| Set custom context for the Wolfram Language symbol that will hold the details of last thrown exception. More... | |
| static const std::string & | getExceptionDetailsSymbolContext () |
| Get current context of the symbol that will hold the details of last thrown exception. More... | |
Friends | |
| class | ErrorManager |
| using LLU::LibraryLinkError::IdType = int |
A type that holds error id numbers.
|
noexcept |
Copy-constructor. If there are any messages parameters on the WSLINK, a deep copy is performed.
|
noexcept |
Move-constructor. Steals messagesParams from e.
|
override |
The destructor closes the link that was used to send message parameters, if any.
|
inlinenoexcept |
Get debug info.
|
static |
Get symbol that will hold details of last thrown exception.
|
static |
Get current context of the symbol that will hold the details of last thrown exception.
|
inlinenoexcept |
Get the value of error code.
|
inlinenoexcept |
Get the value of error code.
|
inlinenoexcept |
Get the value of error code.
|
noexcept |
Copy-assignment operator.
|
noexcept |
Move-assignment operator.
|
noexcept |
Send parameters stored in the loopback link to top-level.
They will be assigned as a List to symbol passed in WLSymbol parameter.
| libData | - WolframLibraryData, if nullptr, the parameters will not be send |
| WLSymbol | - symbol to assign parameters to in top-level |
|
inline |
Set debug info.
| dbg | - additional information helpful in debugging |
|
static |
Set custom context for the Wolfram Language symbol that will hold the details of last thrown exception.
| newContext | - any valid WL context, it must end with a backtick (`) |
| void LLU::LibraryLinkError::setMessageParameters | ( | WolframLibraryData | libData, |
| T &&... | params | ||
| ) |
Store arbitrary number of message parameters in a List expression on a loopback link.
They will travel with the exception until sendParameters is called on the exception.
| T | - any type(s) that WSStream supports |
| libData | - WolframLibraryData, if nullptr, the parameters will not be send |
| params | - any number of message parameters |