Skip to content
This repository has been archived by the owner on Nov 11, 2023. It is now read-only.

Commit

Permalink
1.2.0 Hotfix: Worker Error Handling patch
Browse files Browse the repository at this point in the history
  • Loading branch information
dylhack committed May 16, 2019
1 parent f5c268d commit 5f536c0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vlc.js",
"version": "1.1.0",
"version": "1.2.0",
"description": "A VLC HTTP Endpoint wrapper for NodeJS",
"main": "index.js",
"directories": {
Expand Down
4 changes: 2 additions & 2 deletions src/workers/command.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ module.exports = (details, callback) => {
.replace(/(PORT)/, details.port ? details.port : "9090");
let url = URL.parse(requested, true);
let str = "";
http.get(url, res => {
res.on("error", err => callback(err));
let req = http.get(url, res => {
res.on("data", data => (str += data));
res.on("end", () => {
if (res.statusCode == 200) {
Expand All @@ -47,4 +46,5 @@ module.exports = (details, callback) => {
);
});
});
req.on("error", err => callback(err));
};
4 changes: 2 additions & 2 deletions src/workers/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ module.exports = (details, callback) => {

let url = URL.parse(requested);
let str = "";
http.get(url, res => {
res.on("error", err => callback(err));
let req = http.get(url, res => {
res.on("data", data => (str += data));
res.on("end", () => {
if (res.statusCode == 200) {
Expand All @@ -45,4 +44,5 @@ module.exports = (details, callback) => {
);
});
});
req.on("error", err => callback(err));
};

0 comments on commit 5f536c0

Please sign in to comment.