Files
aicyclingcoach-go/internal/garmin/garth/errors/errors.go
2025-09-17 17:30:18 -07:00

47 lines
747 B
Go

package errors
type GarthError struct {
Message string
Cause error
}
func (e *GarthError) Error() string {
if e.Cause != nil {
return e.Message + ": " + e.Cause.Error()
}
return e.Message
}
func (e *GarthError) Unwrap() error {
return e.Cause
}
type GarthHTTPError struct {
GarthError
StatusCode int
Response string
}
type APIError struct {
GarthHTTPError
}
type IOError struct {
GarthError
}
// AuthenticationError represents an authentication failure (e.g., invalid credentials)
type AuthenticationError struct {
GarthError
}
// OAuthError represents an OAuth authentication error
type OAuthError struct {
GarthError
}
// ValidationError represents a data validation error
type ValidationError struct {
GarthError
}