Skip to content

Commit

Permalink
Fixed error when reading error response streams in node environments
Browse files Browse the repository at this point in the history
  • Loading branch information
m-mohr committed Apr 18, 2019
1 parent b1fd158 commit 2804dda
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions openeo.js
Original file line number Diff line number Diff line change
Expand Up @@ -352,14 +352,14 @@ class Connection {
fileReader.readAsText(error.response.data);
break;
case 'stream':
const chunks = "";
const chunks = [];
error.response.data.on("data", chunk => {
chunks.push(chunk);
});
readStream.on("error", () => {
error.response.data.on("error", () => {
reject(error);
});
readStream.on("end", () => {
error.response.data.on("end", () => {
reject(JSON.parse(Buffer.concat(chunks).toString()));
});
break;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@openeo/js-client",
"version": "0.3.3",
"version": "0.3.4",
"author": "openEO Consortium",
"contributors": [
{
Expand Down

0 comments on commit 2804dda

Please sign in to comment.