Skip to content

Conversation

@MusicDin
Copy link
Member

@MusicDin MusicDin commented Dec 5, 2024

Replace hardcoded strings for container/instance source type.

Also fixed some issue reported by static analysis.

@github-actions github-actions bot added the API Changes to the REST API label Dec 5, 2024
@MusicDin MusicDin marked this pull request as ready for review December 5, 2024 17:59
// Handle errors
if response.Type == api.ErrorResponse {
return nil, "", api.StatusErrorf(resp.StatusCode, response.Error)
return nil, "", api.StatusErrorf(resp.StatusCode, "%s", response.Error)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@markylaing added api.NewStatusError for this scenario to avoid needing the parsing cost of fmt.Errorf

Copy link
Member

@tomponline tomponline left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@tomponline tomponline merged commit 81495c0 into canonical:main Dec 6, 2024
26 checks passed
@MusicDin MusicDin deleted the fix/constants branch December 6, 2024 08:34
tomponline added a commit that referenced this pull request Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

API Changes to the REST API

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants