Dashboard › craft › Craft cloudflare target: reportError() …
019f8443-d23e-79b5-8879-7cbae8f31e18| Project | Hits | Last recalled |
|---|---|---|
| opencode | 1 | 9d ago |
Trap: calling reportError() (which throws, meant to hard-fail on real misconfig) from inside a try block whose catch is designed to soft-fail transient errors looks correct — reportError should propagate as a rejection. But the surrounding catch can't distinguish 'intentional hard-fail' from 'unexpected error' and swallows it into a warning instead, silently degrading a hard-fail into a soft-fail. Fix: restructure so the try/catch only wraps the network fetch + JSON parse and returns a result; check the result and call reportError() OUTSIDE that try block for real misconfig (e.g. 404 project-not-found), keeping soft-fail warn+continue for transient 5xx/network errors inside. Applied in resolveProductionBranch(), src/targets/cloudflare.ts.