Skip to content

Handle empty API responses without crashes#85

Open
davidzaro wants to merge 2 commits into
labmain:mainfrom
davidzaro:main
Open

Handle empty API responses without crashes#85
davidzaro wants to merge 2 commits into
labmain:mainfrom
davidzaro:main

Conversation

@davidzaro

Copy link
Copy Markdown

Closes #35
/claim #35
Adds src/api-response.js to normalize empty API responses into ApiResponseError with a toast payload.
Adds test/api-response.test.js covering null, empty text, valid JSON, valid false, and failed responses.

Verification:
npm test
node test/api-response.test.js

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.

Add error handling for empty API responses

1 participant