blob: fcf3ad0a58f11857a0e7d5f36a430e1576d2ce37 [file] [log] [blame]
David Symonds4d3336d2014-02-02 23:32:221// 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
5package appengine
6
Sebastiaan van Stijna1ae2142023-03-01 18:29:447import "context"
David Symondsd1e7e222015-01-28 05:44:068
David Symonds4d3336d2014-02-02 23:32:229// IsTimeoutError reports whether err is a timeout error.
10func IsTimeoutError(err error) bool {
David Symondsd1e7e222015-01-28 05:44:0611 if err == context.DeadlineExceeded {
12 return true
13 }
David Symonds4d3336d2014-02-02 23:32:2214 if t, ok := err.(interface {
15 IsTimeout() bool
16 }); ok {
17 return t.IsTimeout()
18 }
19 return false
20}