Skip to content

Commit

Permalink
Merge pull request #416 from anvial/JUJU-5512-stack-trace-running-ter…
Browse files Browse the repository at this point in the history
…raform-apply

Adds error check to ReadModel function
  • Loading branch information
hmlanigan authored Mar 1, 2024
2 parents bea9ea1 + deb941a commit 501291b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/juju/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,10 @@ func (c *modelsClient) ReadModel(name string) (*ReadModelResponse, error) {
return nil, &modelNotFoundError{uuid: modelUUIDTag.Id()}
}

// Check if the model has an error first
if models[0].Error != nil {
return nil, models[0].Error
}
modelInfo := *models[0].Result

modelConfig, err := modelconfigClient.ModelGet()
Expand Down

0 comments on commit 501291b

Please sign in to comment.