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 5package appengine 6 7import "golang.org/x/net/context" 8 9// IsTimeoutError reports whether err is a timeout error. 10func 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} 21