Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(394)

Side by Side Diff: dm/tools/dmtool/vizQuery.go

Issue 2963503003: [errors] Greatly simplify common/errors package. (Closed)
Patch Set: fix nits Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « dm/appengine/mutate/timeout_execution.go ('k') | grpc/grpcutil/errors.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The LUCI Authors. All rights reserved. 1 // Copyright 2016 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 main 5 package main
6 6
7 import ( 7 import (
8 "bytes" 8 "bytes"
9 "fmt" 9 "fmt"
10 "os" 10 "os"
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 } 227 }
228 client.Options.Insecure = lhttp.IsLocalHost(r.host) 228 client.Options.Insecure = lhttp.IsLocalHost(r.host)
229 dc := dm.NewDepsPRPCClient(client) 229 dc := dm.NewDepsPRPCClient(client)
230 230
231 prev := "" 231 prev := ""
232 seq := 0 232 seq := 0
233 233
234 for c.Err() == nil { 234 for c.Err() == nil {
235 gdata, err := runQuery(c, dc, query) 235 gdata, err := runQuery(c, dc, query)
236 if err != nil { 236 if err != nil {
237 » » » if errors.Contains(err, context.Canceled) { 237 » » » if errors.Any(err, func(err error) bool { return err == context.Canceled }) {
238 return 0 238 return 0
239 } 239 }
240 logging.WithError(err).Errorf(c, "error running query") 240 logging.WithError(err).Errorf(c, "error running query")
241 return 1 241 return 1
242 } 242 }
243 243
244 if gdata != nil { 244 if gdata != nil {
245 newVal := renderDotFile(gdata) 245 newVal := renderDotFile(gdata)
246 if prev != newVal { 246 if prev != newVal {
247 prev = newVal 247 prev = newVal
(...skipping 28 matching lines...) Expand all
276 return 0 276 return 0
277 } 277 }
278 } 278 }
279 } 279 }
280 } 280 }
281 281
282 clock.Sleep(c, time.Second/4) 282 clock.Sleep(c, time.Second/4)
283 } 283 }
284 return 0 284 return 0
285 } 285 }
OLDNEW
« no previous file with comments | « dm/appengine/mutate/timeout_execution.go ('k') | grpc/grpcutil/errors.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698