本站源代码
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.

21 lines
465B

  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. }
上海开阖软件有限公司 沪ICP备12045867号-1