Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test case for internal/errors/http.go #908

Merged
merged 6 commits into from
Jan 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions internal/errors/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,31 +20,37 @@ package errors
import "time"

var (
// HTTP.

// ErrInvalidAPIConfig represents an error that the API configuration is invalid.
ErrInvalidAPIConfig = New("invalid api config")

// ErrInvalidRequest represents an error that the API request is invalid.
ErrInvalidRequest = New("invalid request")

// ErrHandler represents a function to generate an error that the handler returned an error.
hlts2 marked this conversation as resolved.
Show resolved Hide resolved
ErrHandler = func(err error) error {
return Wrap(err, "handler returned error")
}

// ErrHandlerTimeout represents a function to generate an error that the handler was time out.
hlts2 marked this conversation as resolved.
Show resolved Hide resolved
ErrHandlerTimeout = func(err error, dur time.Duration) error {
return Wrapf(err, "handler timeout %s", dur.String())
}

// ErrRequestBodyCloseAndFlush represents a function to generate an error that the flush of the request body and the close failed.
ErrRequestBodyCloseAndFlush = func(err error) error {
return Wrap(err, "request body flush & close failed")
}

// ErrRequestBodyClose represents a function to generate an error that the close of the request body failed.
ErrRequestBodyClose = func(err error) error {
return Wrap(err, "request body close failed")
}

// ErrRequestBodyFlush represents a function to generate an error that the flush of the request body failed.
ErrRequestBodyFlush = func(err error) error {
return Wrap(err, "request body flush failed")
}

// ErrTransportRetryable represents an error that the transport is retryable.
ErrTransportRetryable = New("transport is retryable")
)
Loading