amo/api/errors.go

27 lines
523 B
Go
Raw Normal View History

package api
import (
"errors"
2024-03-04 04:31:33 +03:00
"fmt"
)
var (
2024-05-30 11:43:10 +03:00
ErrNoContent = errors.New("no content")
ErrNoAuth = errors.New("not authorized")
ErrUnreachable = errors.New("unreachable")
ErrInvalidOptionsURL = errors.New("invalid URL options")
ErrInvalidExchangeAuthOptions= errors.New(
"invalid ExchangeAuth options",
)
ErrUrlParsing= errors.New("URL parsing")
)
2024-03-04 04:31:33 +03:00
2024-05-30 11:43:10 +03:00
func NewErrorAPI(err error) error {
return fmt.Errorf("NewAPI: %w", err)
2024-03-04 04:31:33 +03:00
}
2024-05-30 11:43:10 +03:00
func NewRequestError(err error) error {
2024-03-04 04:31:33 +03:00
return fmt.Errorf("RequestError: %w", err)
}