This repository has been archived on 2023-04-13. You can view files and clone it, but cannot push or open issues or pull requests.
go-discogs/errors.go
2019-06-06 15:18:10 +03:00

23 lines
434 B
Go

package discogs
import (
"fmt"
"strings"
)
// Error represents a Discogs API error
type Error struct {
Message string
}
func (e *Error) Error() string {
return fmt.Sprintf("discogs error: %s", strings.ToLower(e.Message))
}
// APIErrors
var (
ErrUnauthorized = &Error{"authentication required"}
ErrCurrencyNotSupported = &Error{"currency does not supported"}
ErrUserAgentInvalid = &Error{"invalid user-agent"}
)