mirror of
https://github.com/sstent/aicyclingcoach-go.git
synced 2026-01-28 18:11:37 +00:00
47 lines
747 B
Go
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
|
|
}
|