Standard_LicenseError
Standard_LicenseError is an OCCT FoundationClasses (TKernel) exception derived from Standard_Failure, thrown when a licensing validation check fails or license authorization is invalid for a component or extension.
Standard_LicenseError is a standard C++ exception class declared in Open CASCADE Technology under the FoundationClasses module within the TKernel toolkit (Standard package). Subclassing Standard_Failure, it represents error conditions triggered during license checking routines in OCCT extensions, custom application modules, or proprietary plugins built on the OCCT architecture. The exception class integrates with the standard OCCT Runtime Type Information (RTTI) system, provides macros for conditional throwing, and interoperates with Standard_ErrorHandler.
Standard_LicenseError is thrown when a license verification function detects that authorization credentials for a module or algorithm are missing, corrupted, expired, or invalid for the host environment. It is raised either directly by invoking Standard_LicenseError::Raise() or conditionally using the Standard_LicenseError_Raise_if macro when the evaluated condition indicates a licensing violation. Additionally, Standard_LicenseError serves as the base class for more specific licensing exceptions such as Standard_LicenseNotFound.
#include <iostream>
#include <Standard_LicenseError.hxx>
int main()
{
try
{
bool isLicensed = false;
Standard_LicenseError_Raise_if(!isLicensed, "LicenseError: Feature authorization check failed");
}
catch (const Standard_LicenseError& anException)
{
std::cerr << "Caught exception: " << anException.GetMessageString() << std::endl;
return 1;
}
return 0;
}
Ensure valid license keys, server connections, or authorization credentials are provided before executing protected routines, and handle licensing failures gracefully using Standard_Failure or Standard_LicenseError catch blocks.
```cpp
#include <iostream>
#include <Standard_LicenseError.hxx>
bool verifyEntitlement(const char* featureName)
{
return featureName != nullptr;
}
int main()
{
const char* feature = "AdvancedSurfaceExtension";
try
{
bool isEntitled = verifyEntitlement(feature);
Standard_LicenseError_Raise_if(!isEntitled, "License authorization failed for feature");
std::cout << "Feature license verified successfully for: " << feature << std::endl;
}
catch (const Standard_LicenseError& anException)
{
std::cerr << "Licensing error: " << anException.GetMessageString() << std::endl;
return 1;
}
return 0;
}
```
Open CASCADE Technology OCCT 7.8.0 — Standard_LicenseError.hxx — retrieved 2026-08-11
Standard_LicenseError.hxx File Reference - Open CASCADE Technology Reference Manual