Lightweight 0.20260522.0
Loading...
Searching...
No Matches
Lightweight::SqlLockError Struct Reference

#include <SqlAdvisoryLock.hpp>

Public Attributes

SqlLockFailureReason reason {}
 What went wrong, at the granularity callers actually care about.
 
std::string lockName
 
std::chrono::milliseconds timeout {}
 Requested timeout (zero for Release).
 
std::string message
 
std::optional< SqlErrorInfoinfo
 Set on DriverError; carries SQLSTATE / native error / driver text.
 

Detailed Description

Structured error returned by SqlAdvisoryLockHandler::TryAcquire and SqlAdvisoryLockHandler::Release.

Lets callers propagate the root cause of a lock failure (timeout vs. deadlock vs. driver-level fault) instead of having to text-match an exception message.

Definition at line 46 of file SqlAdvisoryLock.hpp.

Member Data Documentation

◆ reason

SqlLockFailureReason Lightweight::SqlLockError::reason {}

What went wrong, at the granularity callers actually care about.

Definition at line 49 of file SqlAdvisoryLock.hpp.

◆ lockName

std::string Lightweight::SqlLockError::lockName

The lock name that was being acquired or released — handy when several distinct locks coexist in a process.

Definition at line 52 of file SqlAdvisoryLock.hpp.

◆ timeout

std::chrono::milliseconds Lightweight::SqlLockError::timeout {}

Requested timeout (zero for Release).

Definition at line 54 of file SqlAdvisoryLock.hpp.

◆ message

std::string Lightweight::SqlLockError::message

Pre-formatted, human-readable explanation. Already includes the lock name and timeout where relevant, so callers can std::println("{}", err.message) without further formatting.

Definition at line 58 of file SqlAdvisoryLock.hpp.

◆ info

std::optional<SqlErrorInfo> Lightweight::SqlLockError::info

Set on DriverError; carries SQLSTATE / native error / driver text.

Definition at line 60 of file SqlAdvisoryLock.hpp.


The documentation for this struct was generated from the following file: