Skip to content

Conversation

@cbeck88
Copy link
Contributor

@cbeck88 cbeck88 commented Dec 1, 2025

this adds a new pattern for handling errors when json bodies don't match the rust schema, so that the errors include more detail of what didn't deserialize. this helped me figure out what was wrong when the get_assets endpoint failed when monad was added

extremeandy
extremeandy previously approved these changes Dec 2, 2025
@extremeandy extremeandy dismissed their stale review December 2, 2025 06:18

Added feedback

@extremeandy
Copy link
Contributor

Another idea could be to just use tracing and log the body, if this is more for debug.

@cbeck88
Copy link
Contributor Author

cbeck88 commented Dec 2, 2025

Another idea could be to just use tracing and log the body, if this is more for debug.

yeah, that's a good idea too, and it's less noise in the API.

happy to rewrite the PR that way

@extremeandy
Copy link
Contributor

Another idea could be to just use tracing and log the body, if this is more for debug.

yeah, that's a good idea too, and it's less noise in the API.

happy to rewrite the PR that way

That'd be my preference but not sure what others think :)

@cbeck88
Copy link
Contributor Author

cbeck88 commented Dec 3, 2025

done, lmk what you think

@cbeck88 cbeck88 force-pushed the more-deserialization-error-context branch 2 times, most recently from d155346 to fbf5e34 Compare December 3, 2025 18:17
@cbeck88
Copy link
Contributor Author

cbeck88 commented Dec 3, 2025

rebased on master and resolved conflicts

@cbeck88 cbeck88 changed the title add monad, and put more context in deserialization errors put more context in deserialization errors Dec 3, 2025
@cbeck88 cbeck88 changed the title put more context in deserialization errors show more context when deserialization errors occur Dec 3, 2025
@cbeck88
Copy link
Contributor Author

cbeck88 commented Dec 13, 2025

CI failure looks unrelated:

0s
Run cargo fmt --all --check
cargo fmt --all --check
shell: /usr/bin/bash -e {0}
env:
CARGO_HOME: /home/runner/.cargo
CARGO_INCREMENTAL: 0
CARGO_TERM_COLOR: always
CACHE_ON_FAILURE: false
Error: An error occurred trying to start process '/usr/bin/bash' with working directory '/home/runner/work/bpx-api-client/bpx-api-client/rust'. No such file or directory
Run cargo fmt --all --check
cargo fmt --all --check
shell: /usr/bin/bash -e {0}
env:
CARGO_HOME: /home/runner/.cargo
CARGO_INCREMENTAL: 0
CARGO_TERM_COLOR: always
CACHE_ON_FAILURE: false
Error: An error occurred trying to start process '/usr/bin/bash' with working directory '/home/runner/work/bpx-api-client/bpx-api-client/rust'. No such file or directory

this helps to debug when the API breaks, and helped me figure out
what was wrong when Monad was added
@cbeck88 cbeck88 force-pushed the more-deserialization-error-context branch from 9e8e665 to 57af0ed Compare December 27, 2025 15:17
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