restore daemon error surface for wings 4xx#2325
Conversation
📝 WalkthroughWalkthroughThis PR refactors HTTP error handling in the Daemon repository layer. DaemonFileRepository methods transition from checking ChangesHTTP Error Handling and Token Validation Refactor
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
All contributors have signed the CLA ✍️ ✅ |
|
I have read the CLA Document and I hereby sign the CLA |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@app/Repositories/Daemon/DaemonFileRepository.php`:
- Around line 45-46: The current guard uses truthiness on $notLargerThan which
treats 0 as "no limit"; change the check to an explicit null comparison so a
zero-byte limit is honored (e.g. replace the condition that uses $notLargerThan
in the same block where FileSizeTooLargeException is thrown with an explicit !==
null check before comparing $length to $notLargerThan).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: e8bab833-e1b3-44e3-b0c6-b13437cef223
📒 Files selected for processing (2)
app/Repositories/Daemon/DaemonFileRepository.phpapp/Repositories/Daemon/DaemonRepository.php
💤 Files with no reviewable changes (1)
- app/Repositories/Daemon/DaemonRepository.php
follow-up to #1417 which introduced a regression.
before:
the clientError short-circuit returns false on any 4xx error, so throwIf skips $response->throw(). the fire-and-forget callers (delete, sync, reinstall, cancelTransfer, create) return void on 404 against wings beta25. this was identified as it matched reports from our users of "server stuck installing", "config not applied with no error", "delete succeeded but container still running".
additionally getSystemInformation throws a misleading "is not Pelican Wings !" on 4xx, the body-shape check fires on the error body.
change:
drop the short-circuit. file repo's three post-call status checks move into RequestException catches so the typed exceptions still fire.
after:
RequestException throws on 4xx like 5xx already did. previously silent 4xx now surface as filament toasts in the UI. file-manager UX from #1417 unchanged. getSystemInformation throws RequestException with the actual status.