2025-03-28 19:57:44 +01:00

29 lines
599 B
Go

package core
// BackupError represents an error that occurred during backup operations
type BackupError struct {
Message string
Cause error
}
// Error implements the error interface
func (e *BackupError) Error() string {
if e.Cause != nil {
return e.Message + ": " + e.Cause.Error()
}
return e.Message
}
// Unwrap returns the underlying cause of the error
func (e *BackupError) Unwrap() error {
return e.Cause
}
// NewBackupError creates a new BackupError
func NewBackupError(message string, cause error) *BackupError {
return &BackupError{
Message: message,
Cause: cause,
}
}