Handle 404 on account details request

Signed-off-by: Steven4Hooisma <112615049+Steven4Hooisma@users.noreply.github.com>
This commit is contained in:
Steven4Hooisma
2026-07-23 16:42:05 +02:00
committed by Aurélien Sibiril
parent ca6d543eeb
commit c5a110b7a6

View File

@@ -177,6 +177,10 @@ func (d *UpCloudDriver) fetchAccountDetails(ctx context.Context, username string
defer func() { _ = httpResp.Body.Close() }()
if httpResp.StatusCode == http.StatusNotFound {
return &upcloudAccountDetails{}, nil
}
if httpResp.StatusCode < 200 || httpResp.StatusCode >= 300 {
return nil, fmt.Errorf("cannot fetch upcloud account details: unexpected status %d", httpResp.StatusCode)
}