53 return "Device not initialized";
55 return "Device initialization failed";
57 return "GPIO initialization failed";
59 return "GPIO line request failed";
61 return "SPI initialization failed";
63 return "SPI device open failed";
65 return "SPI configuration failed";
67 return "Invalid pin number";
69 return "Data transfer failed";
73 return "Driver not initialized";
75 return "Driver initialization failed";
77 return "Invalid display mode";
79 return "Operation timed out";
83 return "Display not ready";
85 return "Display refresh failed";
89 return "File not found";
91 return "Invalid format";
95 return "Invalid dimensions";
97 return "Unknown error";
167 [[nodiscard]]
auto what() const -> std::string_view {
205 if (context.empty()) {
208 return {code, std::string(
to_string(code)) +
": " + std::string(context)};
ErrorCode
Unified error codes for all libepaper operations.
Definition errors.hpp:14
@ InvalidPin
Invalid GPIO pin number.
@ DeviceNotInitialized
Device has not been initialized.
@ SPIInitFailed
SPI initialization failed.
@ FileNotFound
Image file not found.
@ DriverNotInitialized
Driver has not been initialized.
@ LoadFailed
Failed to load image data.
@ InvalidDimensions
Invalid image dimensions.
@ InvalidMode
Invalid display mode specified.
@ DisplayNotReady
Display is not ready for operation.
@ DriverInitFailed
Driver initialization failed.
@ GPIOInitFailed
GPIO initialization failed (libgpiod)
@ DeviceInitFailed
Device initialization failed.
@ GPIORequestFailed
GPIO line request failed.
@ SPIConfigFailed
SPI configuration failed.
@ Timeout
Operation timed out.
@ SPIDeviceOpenFailed
SPI device open failed.
@ InvalidFormat
Invalid or unsupported image format.
@ TransferFailed
SPI/data transfer failed.
@ RefreshFailed
Display refresh operation failed.
auto make_error(ErrorCode code, std::string_view context={}) -> Error
Definition errors.hpp:204
constexpr auto to_string(ErrorCode code) -> std::string_view
Convert error code to string representation.
Definition errors.hpp:49
Definition errors.hpp:140
constexpr Error(ErrorCode c)
Construct error with code only.
Definition errors.hpp:149
std::string message
Optional detailed error message.
Definition errors.hpp:142
ErrorCode code
Error code.
Definition errors.hpp:141
auto what() const -> std::string_view
Get string representation of the error.
Definition errors.hpp:167
Error(ErrorCode c, std::string msg)
Construct error with code and message.
Definition errors.hpp:157