Skip to content

Commit

Permalink
feat: fail on non existing apps (#52)
Browse files Browse the repository at this point in the history
Fixes #3
  • Loading branch information
kbudde authored Aug 19, 2023
1 parent 5a0e4d7 commit 87aafa3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions internal/myks/environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,16 +268,19 @@ func (e *Environment) initApplications(applicationNames []string) error {
for name, proto := range e.foundApplications {
app, err := NewApplication(e, name, proto)
if err != nil {
log.Warn().Err(err).Str("dir", e.Dir).Interface("app", name).Msg(e.Msg("Unable to initialize application"))
return fmt.Errorf("unable to initialize application %s for env %s. Err: %w", name, e.Dir, err)
} else {
e.Applications = append(e.Applications, app)
}
}
return nil
}
// applicationNames provided via commandline. Be more friendly
for _, appName := range applicationNames {
proto := e.foundApplications[appName]
if proto == "" {
return errors.New("Application not found: " + appName)
log.Warn().Str("dir", e.Dir).Interface("app", appName).Msg(e.Msg("Application not found"))
continue
}
app, err := NewApplication(e, appName, proto)
if err != nil {
Expand Down

0 comments on commit 87aafa3

Please sign in to comment.