Skip to content

fix: return 409 instead of 502 when a pushed action fails - #201

Merged
paragmore merged 1 commit into
tetherto:developfrom
paragmore:fix/action-failure-status
Aug 26, 2026
Merged

fix: return 409 instead of 502 when a pushed action fails#201
paragmore merged 1 commit into
tetherto:developfrom
paragmore:fix/action-failure-status

Conversation

@paragmore

@paragmore paragmore commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Work-order and spare-part handlers set statusCode 502 when a pushed action returned errors. Cloudflare replaces origin 502 responses with its own error page, so the actual ERR_ message — e.g. ERR_NO_AVAILABLE_IP when a work order's replacement miner can't get a lease — never reached the client; curl and the UI only saw a generic origin_bad_gateway error.

These failures are reported by the workers for a request that conflicts with the current system state, so they now return 409 with the ERR_ message intact, which Cloudflare passes through unchanged. 502 stays reserved for actual gateway problems.

Related unit suites pass (the finance.handlers test failure is pre-existing on develop).

@paragmore paragmore changed the title fix: return 400 instead of 502 when a pushed action fails fix: return typed error statuses instead of 502 when a pushed action fails Aug 26, 2026
Work-order and spare-part handlers responded with 502 when a pushed
action came back with errors, but Cloudflare replaces origin 502 bodies
with its own error page, so the ERR_ reason (for example
ERR_NO_AVAILABLE_IP when the subnet has no free lease) never reached the
client. These are failures reported by the workers for a request that
conflicts with the current system state, so return 409 with the ERR_
message intact.
@paragmore
paragmore force-pushed the fix/action-failure-status branch from 8cb98cb to 7746299 Compare August 26, 2026 11:27
@paragmore paragmore changed the title fix: return typed error statuses instead of 502 when a pushed action fails fix: return 409 instead of 502 when a pushed action fails Aug 26, 2026
@paragmore
paragmore merged commit f08e0e1 into tetherto:develop Aug 26, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants