You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
465 B

  1. // Copyright 2013 Google Inc. All rights reserved.
  2. // Use of this source code is governed by the Apache 2.0
  3. // license that can be found in the LICENSE file.
  4. package appengine
  5. import "golang.org/x/net/context"
  6. // IsTimeoutError reports whether err is a timeout error.
  7. func IsTimeoutError(err error) bool {
  8. if err == context.DeadlineExceeded {
  9. return true
  10. }
  11. if t, ok := err.(interface {
  12. IsTimeout() bool
  13. }); ok {
  14. return t.IsTimeout()
  15. }
  16. return false
  17. }