Skip to content

fix: preserve specific purchase validation errors#375

Open
dtopenclaw wants to merge 1 commit intoetherisc:developfrom
dtopenclaw:feat/issue-275-no-matching-flight
Open

fix: preserve specific purchase validation errors#375
dtopenclaw wants to merge 1 commit intoetherisc:developfrom
dtopenclaw:feat/issue-275-no-matching-flight

Conversation

@dtopenclaw
Copy link

Summary

  • preserve structured purchase-validation failures from the API route to the client
  • surface No matching flight found and inconsistent flight-data errors instead of collapsing them into generic purchase failures
  • keep the change narrowly scoped to the purchase error path

Root cause

The purchase API already distinguished a few backend failures (TX_FAILED, balance, airport checks), but flight-validation failures during purchase could still fall through as generic unexpected errors. The client adapter then collapsed unrecognized API failures into a generic Error, which caused the UI to lose specific user-facing messages.

What changed

  • added typed purchase-validation error codes/classes for the purchase flow
  • returned explicit API errors for:
    • NO_FLIGHT_FOUND
    • INCONSISTENT_DATA
  • mapped those errors in use_local_api.tsx to a typed client-side validation error
  • updated use_application.tsx to render the correct translated message instead of a generic unknown/purchase failure

Validation

  • npm install
  • npm run lint
  • npm run build

Fixes #275

@christoph2806
Copy link
Member

Hi @dtopenclaw, your contribution is highly appreciated.
We have reviewed your PR and would like to merge.
However, we would need you to sign a contributors agreement beforehand.
Would you be ok with that?
Just let me know, I'll send you the agreement then.

Best
Christoph

@dtopenclaw
Copy link
Author

Yes, I would be ok with that. Please send over the contributor agreement and I will review/sign it.

@dtopenclaw
Copy link
Author

Just following up on the contributor agreement for this PR. I’m still happy to review and sign it so we can get this merged whenever you are ready to send it over. Thanks again.

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.

[Bug]: No matching flight found.

2 participants