Wrap network failures from baza fetch calls#30
Conversation
|
@GHX5T-SOL Hi! Your branch name " |
|
Thanks for flagging this. I missed the branch-name convention on this PR; I will use the ticket number as the branch name for future Zerocracy contributions. |
kreinba
left a comment
There was a problem hiding this comment.
The try/catch wraps the rejected fetch in a thrown Error with the original kept on cause, the new test asserts the message and cause for a TypeError thrown from fetch, jest and eslint pass locally. Addresses #28 without touching unrelated code. 0 inline comments.
|
Please fix the merge conflicts so this pull request can be merged. |
Summary
fetch()calls inbaza()with a consistentErrorcauseFixes #28.
Validation
npx jest --config jest.config.ts --no-color --ci test/baza.test.ts -t 'wraps network failures' --coverage=falsenpx eslint . --config eslint.config.mjsnpx tsc --target es2020 --module nodenext --outDir dist index.ts src/baza.ts src/prompts.ts src/resources.ts src/server.ts src/to_gpt.ts src/tools.tsgit diff --check HEAD~1 HEADgit show --format= --patch HEAD | gitleaks stdin --no-banner --redactNotes
npx jest --config jest.config.ts --no-color --cicurrently fails in the existing livebazaand server tests because the fixture token receives HTTP error responses from the Zerocracy API; the focused network-failure regression passes.