Skip to content

refactor: align HTTP status codes with error classification#686

Open
Sotatek-DucPhung wants to merge 1 commit intodevelopfrom
feat/refactor-http-5xx-and-4xx
Open

refactor: align HTTP status codes with error classification#686
Sotatek-DucPhung wants to merge 1 commit intodevelopfrom
feat/refactor-http-5xx-and-4xx

Conversation

@Sotatek-DucPhung
Copy link
Collaborator

@Sotatek-DucPhung Sotatek-DucPhung commented Feb 11, 2026

#684

Derive HTTP status and retriable flag from error code range:

  • 4xxx errors → HTTP 400 (BAD_REQUEST) + retriable=true
  • 5xxx errors → HTTP 500 (INTERNAL_SERVER_ERROR) + retriable=false

This removes ad-hoc retriable booleans from ExceptionFactory methods and makes retry behavior predictable for integrators.

@Sotatek-DucPhung Sotatek-DucPhung marked this pull request as draft February 11, 2026 09:58
@github-actions
Copy link
Contributor

💥 Preprod Tests: DEPLOYMENT FAILED

🔗 Action Run #192

Tests run against preprod network with live blockchain data

"code": 4039,
"message": "Provided address has wrong casing, this might lead to problems with other tools",
"retriable": false
"retriable": true
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there are errors here:

retriable = true -> HTTP 5xx category of errors
retriable = false -> HTTP 4xx category of errors

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also retriable must stay in the rosetta response, we cannot change this, contract mus be the same, this PR should only affect HTTP status code (integer) that's it.

Map retriable=true → HTTP 500, retriable=false → HTTP 400 instead of
returning HTTP 500 for all errors.
@Sotatek-DucPhung Sotatek-DucPhung force-pushed the feat/refactor-http-5xx-and-4xx branch from 9d74f04 to f7c8666 Compare February 12, 2026 03:55
@github-actions
Copy link
Contributor

💥 Preprod Tests: DEPLOYMENT FAILED

🔗 Action Run #193

Tests run against preprod network with live blockchain data

@github-actions
Copy link
Contributor

❌ Preprod Tests: FAILED

📊 View Detailed Test Report

🔗 Action Run #193

Tests run against preprod network with live blockchain data

@Sotatek-DucPhung Sotatek-DucPhung marked this pull request as ready for review February 12, 2026 11:55
@Sotatek-DucPhung Sotatek-DucPhung changed the title feat: align HTTP status codes with error classification refactor: align HTTP status codes with error classification Feb 12, 2026
@matiwinnetou matiwinnetou added this to the 2.1.0 milestone Feb 12, 2026
@github-actions
Copy link
Contributor

❌ Preprod Tests: FAILED

📊 View Detailed Test Report

🔗 Action Run #193

Tests run against preprod network with live blockchain data

1 similar comment
@github-actions
Copy link
Contributor

❌ Preprod Tests: FAILED

📊 View Detailed Test Report

🔗 Action Run #193

Tests run against preprod network with live blockchain data

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.

2 participants