🧹 Fix ignored error for DataUsageInfo in BucketsHandler#62
Conversation
Co-authored-by: damacus <40786+damacus@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
🎯 What: Handled the previously ignored error from
mdm.DataUsageInfo(c.Request().Context())ininternal/handlers/buckets_handler.go.💡 Why: Silently ignoring errors is poor practice. Logging the error improves visibility and helps debugging when users lack sufficient admin permissions to fetch data usage. Since the code handles a nil or empty
BucketSizesproperly when falling back to 0, it's safer to just log this specific error rather than throw an HTTP 500 block for users who only have bucket listing permissions, not global permissions.✅ Verification: Ran
go test ./...in the background utilizing automatic downloading, ensuring existing functionality tests pass. Verified the refactored chunk avoids shadowing scope and continues execution when the error triggers.✨ Result: Better error visibility, improved maintainability of the handlers package.
PR created automatically by Jules for task 9830336635236494968 started by @damacus