| OLD | NEW |
| 1 // Copyright 2015 The LUCI Authors. All rights reserved. | 1 // Copyright 2015 The LUCI Authors. All rights reserved. |
| 2 // Use of this source code is governed under the Apache License, Version 2.0 | 2 // Use of this source code is governed under the Apache License, Version 2.0 |
| 3 // that can be found in the LICENSE file. | 3 // that can be found in the LICENSE file. |
| 4 | 4 |
| 5 package swarming | 5 package swarming |
| 6 | 6 |
| 7 import ( | 7 import ( |
| 8 "net/http" | 8 "net/http" |
| 9 "os" | 9 "os" |
| 10 | 10 |
| 11 "google.golang.org/api/googleapi" | |
| 12 | |
| 13 "github.com/julienschmidt/httprouter" | 11 "github.com/julienschmidt/httprouter" |
| 14 "golang.org/x/net/context" | 12 "golang.org/x/net/context" |
| 13 "google.golang.org/api/googleapi" |
| 15 | 14 |
| 16 "github.com/luci/luci-go/milo/appengine/settings" | 15 "github.com/luci/luci-go/milo/appengine/settings" |
| 17 "github.com/luci/luci-go/milo/common/miloerror" | 16 "github.com/luci/luci-go/milo/common/miloerror" |
| 18 "github.com/luci/luci-go/server/templates" | 17 "github.com/luci/luci-go/server/templates" |
| 19 ) | 18 ) |
| 20 | 19 |
| 21 const ( | 20 const ( |
| 22 defaultSwarmingServer = "chromium-swarm.appspot.com" | 21 defaultSwarmingServer = "chromium-swarm.appspot.com" |
| 23 defaultSwarmingDevServer = "chromium-swarm-dev.appspot.com" | 22 defaultSwarmingDevServer = "chromium-swarm-dev.appspot.com" |
| 24 ) | 23 ) |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 } | 138 } |
| 140 | 139 |
| 141 // isAPINotFound returns true if err is a HTTP 404 API response. | 140 // isAPINotFound returns true if err is a HTTP 404 API response. |
| 142 func isAPINotFound(err error) bool { | 141 func isAPINotFound(err error) bool { |
| 143 if apiErr, ok := err.(*googleapi.Error); ok && apiErr.Code == http.Statu
sNotFound { | 142 if apiErr, ok := err.(*googleapi.Error); ok && apiErr.Code == http.Statu
sNotFound { |
| 144 return true | 143 return true |
| 145 } | 144 } |
| 146 | 145 |
| 147 return false | 146 return false |
| 148 } | 147 } |
| OLD | NEW |