Update primary error functions to take a context, deprecate old functions (#1358)
* add new error funcs which take a ctx and deprecate existing funcs * use context where available when writing error events * remove circular internal/errors pkg dep * suppress some chatty errors using errors.WithoutEvent() * convert auth oidc funcs to take context where needed to write events Co-authored-by: Jim <jlambert@hashicorp.com>
This commit is contained in:
1 parent
02ff2db66e
commit
6b78108ecf
227 files changed
+3945
-3736
No files matched your search
@@ -321,6 +321,7 @@ func (c *Command) AutocompleteFlags() complete.Flags {
|
||||
|
||||
func (c *Command) Run(args []string) int {
|
||||
const op = "dev.(Command).Run"
|
||||
ctx := context.TODO()
|
||||
c.CombineLogs = c.flagCombineLogs
|
||||
|
||||
var err error
|
||||
@@ -579,7 +580,7 @@ func (c *Command) Run(args []string) int {
|
||||
}
|
||||
|
||||
var err error
|
||||
c.controller, err = controller.New(conf)
|
||||
c.controller, err = controller.New(ctx, conf)
|
||||
if err != nil {
|
||||
c.UI.Error(fmt.Errorf("Error initializing controller: %w", err).Error())
|
||||
return base.CommandCliError
|
||||
|
||||
Reference in new issue
Block a user