Skip to content

Commit

Permalink
unify error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
gamoutatsumi committed Apr 16, 2024
1 parent b3e1865 commit e7fe1bb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pool-agent/cmd/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,19 @@ type instances map[string]struct{}
func newAgent(ctx context.Context) (*Agent, error) {
conf, err := LoadConfig()
if err != nil {
return nil, errors.Wrap(err, "failed to load config")
return nil, fmt.Errorf("load config: %w", err)
}
source, err := slm.ParseAlias(conf.ImageAlias)
if err != nil {
return nil, err
}
c, err := lxd.ConnectLXDUnixWithContext(ctx, "", &lxd.ConnectionArgs{})
if err != nil {
return nil, errors.Wrap(err, "failed to connect lxd")
return nil, fmt.Errorf("connect lxd: %w", err)
}
checkInterval, waitIdleTime, zombieAllowTime, err := LoadParams()
if err != nil {
return nil, errors.Wrap(err, "failed to load params")
return nil, fmt.Errorf("load params: %w", err)
}
creatingInstances := make(map[string]instances)
for _, rt := range conf.ResourceTypesMap {
Expand Down

0 comments on commit e7fe1bb

Please sign in to comment.