Skip to content

fix(baremetal): handle errors in offer list command#5280

Merged
Mia-Cross merged 1 commit intoscaleway:masterfrom
Andarius:fix/baremetal-offer-list-nil-pointer
Jan 15, 2026
Merged

fix(baremetal): handle errors in offer list command#5280
Mia-Cross merged 1 commit intoscaleway:masterfrom
Andarius:fix/baremetal-offer-list-nil-pointer

Conversation

@Andarius
Copy link
Contributor

Summary

  • Fix nil pointer dereference in baremetal offer list command
  • Add proper error handling for ListOffers and ListPublicCatalogProducts API calls

Details

The ListOffers and ListPublicCatalogProducts API calls were ignoring errors (using _), causing a nil pointer dereference when the API returned an error.

Fixes #5278

Test plan

  • Run scw baremetal offer list with invalid/missing credentials - should show proper error instead of panic
  • Run scw baremetal offer list with valid credentials - should work as before

🤖 Generated with Claude Code

@Andarius Andarius requested a review from a team as a code owner January 14, 2026 14:45
@codecov-commenter
Copy link

codecov-commenter commented Jan 14, 2026

Codecov Report

❌ Patch coverage is 33.33333% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 56.96%. Comparing base (c278ab4) to head (7e4a5e6).
⚠️ Report is 1 commits behind head on master.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
internal/namespaces/baremetal/v1/custom_offer.go 33.33% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5280      +/-   ##
==========================================
- Coverage   56.96%   56.96%   -0.01%     
==========================================
  Files         313      313              
  Lines       70256    70260       +4     
==========================================
  Hits        40023    40023              
- Misses      28742    28744       +2     
- Partials     1491     1493       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Mia-Cross Mia-Cross enabled auto-merge January 14, 2026 15:51
@Mia-Cross
Copy link
Contributor

Hi @Andarius,
Thank you for your contribution!
Could you please sign your commit using SSH or GPG ? This is required for it to be merged.

The ListOffers and ListPublicCatalogProducts API calls were ignoring
errors, causing a nil pointer dereference when the API returned an error.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
auto-merge was automatically disabled January 14, 2026 16:37

Head branch was pushed to by a user without write access

@Andarius Andarius force-pushed the fix/baremetal-offer-list-nil-pointer branch from 9600ae6 to 7e4a5e6 Compare January 14, 2026 16:37
@Andarius
Copy link
Contributor Author

Hey @Mia-Cross, is this better? Or should I re open a PR with all the commits signed?

@Mia-Cross
Copy link
Contributor

All good, thank you !

@Mia-Cross Mia-Cross added this pull request to the merge queue Jan 15, 2026
Merged via the queue into scaleway:master with commit cf7b046 Jan 15, 2026
123 checks passed
jremy42 pushed a commit that referenced this pull request Feb 25, 2026
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

scw baremetal offer list

4 participants