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

Side by Side Diff: vpython/application/subcommand_install.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 | « vpython/application/subcommand_delete.go ('k') | vpython/application/subcommand_verify.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 2017 The LUCI Authors. All rights reserved. 1 // Copyright 2017 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 application 5 package application
6 6
7 import ( 7 import (
8 "github.com/maruel/subcommands" 8 "github.com/maruel/subcommands"
9 "golang.org/x/net/context" 9 "golang.org/x/net/context"
10 10
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 c := cli.GetContext(app, cr, env) 43 c := cli.GetContext(app, cr, env)
44 a := getApplication(c, args) 44 a := getApplication(c, args)
45 a.opts.EnvConfig.PruneThreshold = 0 // Don't prune on install. 45 a.opts.EnvConfig.PruneThreshold = 0 // Don't prune on install.
46 a.opts.EnvConfig.OverrideName = cr.name 46 a.opts.EnvConfig.OverrideName = cr.name
47 47
48 return run(c, func(c context.Context) error { 48 return run(c, func(c context.Context) error {
49 err := venv.With(c, a.opts.EnvConfig, false, func(context.Contex t, *venv.Env) error { 49 err := venv.With(c, a.opts.EnvConfig, false, func(context.Contex t, *venv.Env) error {
50 return nil 50 return nil
51 }) 51 })
52 if err != nil { 52 if err != nil {
53 » » » return errors.Annotate(err).Reason("failed to setup the environment").Err() 53 » » » return errors.Annotate(err, "failed to setup the environ ment").Err()
54 } 54 }
55 55
56 logging.Infof(c, "Successfully setup the environment.") 56 logging.Infof(c, "Successfully setup the environment.")
57 return nil 57 return nil
58 }) 58 })
59 } 59 }
OLDNEW
« no previous file with comments | « vpython/application/subcommand_delete.go ('k') | vpython/application/subcommand_verify.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698