aboutsummaryrefslogtreecommitdiff
path: root/pkg/navitia_api_client/error.go
diff options
context:
space:
mode:
authorJulien Dessaux2021-09-15 21:29:12 +0200
committerJulien Dessaux2021-09-15 21:29:12 +0200
commite8b2b01e7c697435f3d20657cdef0ecd54b62d14 (patch)
tree4a4239c21fd2a9b0949abf7c74a3e88c91f6eb82 /pkg/navitia_api_client/error.go
parentRewrote config tests for consistency (diff)
downloadtrains-e8b2b01e7c697435f3d20657cdef0ecd54b62d14.tar.gz
trains-e8b2b01e7c697435f3d20657cdef0ecd54b62d14.tar.bz2
trains-e8b2b01e7c697435f3d20657cdef0ecd54b62d14.zip
Rewrote navitia_api_client tests for consistency
Diffstat (limited to 'pkg/navitia_api_client/error.go')
-rw-r--r--pkg/navitia_api_client/error.go22
1 files changed, 11 insertions, 11 deletions
diff --git a/pkg/navitia_api_client/error.go b/pkg/navitia_api_client/error.go
index 31080de..2600aec 100644
--- a/pkg/navitia_api_client/error.go
+++ b/pkg/navitia_api_client/error.go
@@ -8,12 +8,12 @@ type ApiError struct {
request string
}
-func (e *ApiError) Error() string {
+func (e ApiError) Error() string {
return fmt.Sprintf("Navitia Api error return code %d - %s", e.code, e.request)
}
func newApiError(code int, request string) error {
- return &ApiError{
+ return ApiError{
code: code,
request: request,
}
@@ -25,11 +25,11 @@ type HttpClientError struct {
err error
}
-func (e *HttpClientError) Error() string { return fmt.Sprintf("Navitia HttpClient error %s", e.msg) }
-func (e *HttpClientError) Unwrap() error { return e.err }
+func (e HttpClientError) Error() string { return fmt.Sprintf("Navitia HttpClient error %s", e.msg) }
+func (e HttpClientError) Unwrap() error { return e.err }
func newHttpClientError(msg string, err error) error {
- return &HttpClientError{
+ return HttpClientError{
msg: msg,
err: err,
}
@@ -41,11 +41,11 @@ type JsonDecodeError struct {
err error
}
-func (e *JsonDecodeError) Error() string { return fmt.Sprintf("Navitia JsonDecode error %s", e.msg) }
-func (e *JsonDecodeError) Unwrap() error { return e.err }
+func (e JsonDecodeError) Error() string { return fmt.Sprintf("Navitia JsonDecode error %s", e.msg) }
+func (e JsonDecodeError) Unwrap() error { return e.err }
func newJsonDecodeError(msg string, err error) error {
- return &JsonDecodeError{
+ return JsonDecodeError{
msg: msg,
err: err,
}
@@ -57,13 +57,13 @@ type DateParsingError struct {
err error
}
-func (e *DateParsingError) Error() string {
+func (e DateParsingError) Error() string {
return fmt.Sprintf("Navitia date parsing error %s", e.date)
}
-func (e *DateParsingError) Unwrap() error { return e.err }
+func (e DateParsingError) Unwrap() error { return e.err }
func newDateParsingError(date string, err error) error {
- return &DateParsingError{
+ return DateParsingError{
date: date,
err: err,
}