mirror of
https://github.com/cwinfo/matterbridge.git
synced 2025-07-04 17:07:44 +00:00
Update vendor (#1384)
This commit is contained in:
28
vendor/github.com/slack-go/slack/internal/misc/misc.go
generated
vendored
Normal file
28
vendor/github.com/slack-go/slack/internal/misc/misc.go
generated
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
package misc
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// StatusCodeError represents an http response error.
|
||||
// type httpStatusCode interface { HTTPStatusCode() int } to handle it.
|
||||
type StatusCodeError struct {
|
||||
Code int
|
||||
Status string
|
||||
}
|
||||
|
||||
func (t StatusCodeError) Error() string {
|
||||
return fmt.Sprintf("slack server error: %s", t.Status)
|
||||
}
|
||||
|
||||
func (t StatusCodeError) HTTPStatusCode() int {
|
||||
return t.Code
|
||||
}
|
||||
|
||||
func (t StatusCodeError) Retryable() bool {
|
||||
if t.Code >= 500 || t.Code == http.StatusTooManyRequests {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
Reference in New Issue
Block a user