Skip to content

Commit

Permalink
chore: test fix 3
Browse files Browse the repository at this point in the history
  • Loading branch information
Frazer Smith committed Apr 21, 2021
1 parent 19f8c22 commit c8fb043
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1091,12 +1091,16 @@ class Poppler {
child.stdin.end();
}

let stdErr = "";

child.stderr.on("data", async (data) => {
reject(new Error(data.toString().trim()));
stdErr += data;
});

child.on("close", async (code) => {
if (code === 0) {
if (stdErr !== "") {
reject(new Error(stdErr.trim()));
} else if (code === 0) {
resolve(errorMessages[code]);
} else {
reject(new Error(errorMessages[code]));
Expand Down

0 comments on commit c8fb043

Please sign in to comment.