hubot-freight
Advanced tools
Comparing version 0.0.2 to 0.0.3
{ | ||
"name": "hubot-freight", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"author": "David Cramer <dcramer@gmail.com>", | ||
@@ -5,0 +5,0 @@ "description": "Freight integration for Hubot", |
@@ -26,3 +26,3 @@ // Description: | ||
console.log("Freight: Making request to " + url); | ||
console.log("Freight: Making request to %s", url); | ||
@@ -33,7 +33,8 @@ msg.http(url) | ||
.header("Content-Type", "application/json") | ||
.post(JSON.stringify(data), function(err, resp, body) { | ||
.post(JSON.stringify(data))(function(err, resp, body) { | ||
console.log(resp.statusCode); | ||
if (err) { | ||
msg.reply("Freight says: " + err); | ||
console.error(err); | ||
} else if (200 <= resp.statusCode < 400) { // Or, not an error code. | ||
console.error('HTTP %d: %s', resp.statusCode, err); | ||
} else if (200 <= resp.statusCode && resp.statusCode < 400) { | ||
return; | ||
@@ -43,3 +44,3 @@ } else { | ||
msg.reply("Freight responded with HTTP " + resp.statusCode + ": " + data.error); | ||
console.error("HTTP " + resp.statusCode + ": " + body); | ||
console.error("HTTP %d: %s", resp.statusCode, body); | ||
} | ||
@@ -60,3 +61,3 @@ }); | ||
console.log("Freight: Making request to " + url); | ||
console.log("Freight: Making request to %s", url); | ||
@@ -67,7 +68,7 @@ msg.http(url) | ||
.header("Content-Type", "application/json") | ||
.put(JSON.stringify(data), function(err, resp, body) { | ||
.put(JSON.stringify(data))(function(err, resp, body) { | ||
if (err) { | ||
msg.reply("Freight says: " + err); | ||
console.error(err); | ||
} else if (200 <= resp.statusCode < 400) { // Or, not an error code. | ||
console.error('HTTP %d: %s', resp.statusCode, err); | ||
} else if (200 <= resp.statusCode && resp.statusCode < 400) { | ||
return; | ||
@@ -77,3 +78,3 @@ } else { | ||
msg.reply("Freight responded with HTTP " + resp.statusCode + ": " + data.error); | ||
console.error("HTTP " + resp.statusCode + ": " + body); | ||
console.error("HTTP %d: %s", resp.statusCode, body); | ||
} | ||
@@ -80,0 +81,0 @@ }); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14709
78