Status
class vigil::StatusReturn type for all SDK operations. Encapsulates a status code and an optional human-readable error message.
Status.ok
bool vigil::Status::ok() constChecks whether the operation completed successfully.
Returns:
bool — true if the status code is StatusCode::kOk, false otherwise.
Status.code
vigil::StatusCode vigil::Status::code() constReturns the specific status code for the operation.
Returns:
StatusCode — One of the values from the StatusCode enum.
Status.message
const std::string& vigil::Status::message() constReturns a human-readable description of the error. Empty string on success.
Returns:
const std::string& — Error message, or empty string if the operation succeeded.
Status.operator bool
explicit vigil::Status::operator bool() constBoolean conversion operator. Allows using Status objects directly in conditional expressions. Returns the same value as ok.
Example:
vigil::Status status = embedder.Load();
if (!status) {
std::cerr << "Error: " << status.message() << "\n";
}Status Codes
| Code | Name | Description |
|---|---|---|
| 0 | StatusCode::kOk | Success. |
| 1 | StatusCode::kInvalidArgument | Invalid parameter — wrong sample count, null pointer, etc. |
| 2 | StatusCode::kInvalidState | Operation called in wrong state — e.g., calling EmbedStep before Load. |
| 3 | StatusCode::kModelLoadFailed | Model file not found or corrupt. |
| 4 | StatusCode::kInferenceFailed | Model inference error. |
| 5 | StatusCode::kBufferOverflow | Internal buffer overflow. |
| 6 | StatusCode::kInternalError | Unexpected internal error. |
