diff options
Diffstat (limited to 'vendor/google.golang.org/appengine/timeout.go')
-rw-r--r-- | vendor/google.golang.org/appengine/timeout.go | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/vendor/google.golang.org/appengine/timeout.go b/vendor/google.golang.org/appengine/timeout.go new file mode 100644 index 0000000..05642a9 --- /dev/null +++ b/vendor/google.golang.org/appengine/timeout.go | |||
@@ -0,0 +1,20 @@ | |||
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 | |||
5 | package appengine | ||
6 | |||
7 | import "golang.org/x/net/context" | ||
8 | |||
9 | // IsTimeoutError reports whether err is a timeout error. | ||
10 | func IsTimeoutError(err error) bool { | ||
11 | if err == context.DeadlineExceeded { | ||
12 | return true | ||
13 | } | ||
14 | if t, ok := err.(interface { | ||
15 | IsTimeout() bool | ||
16 | }); ok { | ||
17 | return t.IsTimeout() | ||
18 | } | ||
19 | return false | ||
20 | } | ||