Skip to content

Commit

Permalink
Improve error message when failing to deploy a bundle.
Browse files Browse the repository at this point in the history
User friendly error messages are appreciated by all, especially when
it's easy to do.
  • Loading branch information
hmlanigan committed Sep 27, 2023
1 parent 3237b34 commit a80af78
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal/juju/applications.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,10 +248,12 @@ func (c applicationsClient) CreateApplication(input *CreateApplicationInput) (*C
return nil, fmt.Errorf("expected only one resolution, received %d", len(resolved))
}
resolvedCharm := resolved[0]

if resolvedCharm.Error != nil {
return nil, resolvedCharm.Error
}
if resolvedCharm.Origin.Type == "bundle" {
return nil, jujuerrors.Errorf("%q is a bundle not a charm", input.CharmName)
}

// Figure out the actual series of the charm
var series string
Expand Down

0 comments on commit a80af78

Please sign in to comment.