Skip to content

Commit

Permalink
fix: 🐛 explicit error message for empty response
Browse files Browse the repository at this point in the history
  • Loading branch information
touv committed Jul 9, 2024
1 parent 0cbe93a commit 0cc34fd
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/basics/src/url-connect.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ export default async function URLConnect(data, feed) {
}
if (json) {
const bodyOutRaw = await getStream(response.body);
if (bodyOutRaw === '') {
throw new Error('URL returned an empty response ');
}
const bodyOutArray = JSON.parse(bodyOutRaw);
return from(bodyOutArray).pipe(output);
}
Expand Down

0 comments on commit 0cc34fd

Please sign in to comment.