Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Basic error check functions from standard library
Functions ¶
func GetErrorMessage ¶
GetErrorMessage returns the message for a given error code
func IsNVMLSuccess ¶
IsNVMLSuccess checks if the error is a "SUCCESS" message from NVML
Types ¶
type Error ¶
type Error interface { error Code() ErrorCode WithMessage(msg string) Error WithData(data any) Error GetData() any Unwrap() error }
Error represents a domain-specific error with context
type ErrorCode ¶
type ErrorCode string
ErrorCode represents a unique identifier for each error type
const ( // System errors ErrInternal ErrorCode = "internal_error" ErrInvalidArgument ErrorCode = "invalid_argument" ErrNotImplemented ErrorCode = "not_implemented" // Configuration errors ErrInvalidConfig ErrorCode = "invalid_configuration" ErrMissingConfig ErrorCode = "missing_configuration" ErrBindFlags ErrorCode = "bind_flags_failed" ErrInvalidInterval ErrorCode = "invalid_interval" ErrLoadConfig ErrorCode = "load_configuration" // Logging errors ErrInvalidLogLevel ErrorCode = "invalid_log_level" // Initialization errors ErrInitFailed ErrorCode = "initialization_failed" ErrShutdownFailed ErrorCode = "shutdown_failed" // Resource errors ErrResourceBusy ErrorCode = "resource_busy" ErrResourceNotFound ErrorCode = "resource_not_found" ErrResourceExhausted ErrorCode = "resource_exhausted" // Application errors ErrInitApp ErrorCode = "init_app_failed" ErrMainLoop ErrorCode = "main_loop_failed" ErrSetGPUState ErrorCode = "get_gpu_state_failed" ErrGetGPUState ErrorCode = "get_gpu_state_failed" ErrShutdownGPU ErrorCode = "shutdown_gpu_failed" ErrResetPowerLimit ErrorCode = "reset_power_limit_failed" ErrEnableAutoFan ErrorCode = "enable_auto_fan_failed" // Operation errors ErrOperationFailed ErrorCode = "operation_failed" ErrTimeout ErrorCode = "operation_timeout" ErrInvalidOperation ErrorCode = "invalid_operation" // Metrics errors ErrInitMetrics ErrorCode = "init_metrics_failed" ErrCollectMetrics ErrorCode = "collect_metrics_failed" ErrCloseMetrics ErrorCode = "close_metrics_failed" )
Common error codes
Click to show internal directories.
Click to hide internal directories.