2024-01-19 08:14:23 +03:00
|
|
|
package api
|
|
|
|
|
|
|
|
import (
|
|
|
|
"errors"
|
2024-03-04 04:31:33 +03:00
|
|
|
"fmt"
|
2024-01-19 08:14:23 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
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-01-19 08:14:23 +03:00
|
|
|
)
|
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)
|
|
|
|
}
|
|
|
|
|