Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Report an error if we get a non-200 response when fetching remote scr…

…ipts with jsbuild.
  • Loading branch information...
commit 31ed04e9bdfef50eb3733ad0fdbdc679939dbeb0 1 parent 91a0758
James Coglan authored
Showing with 5 additions and 1 deletion.
  1. +5 −1 bin/jsbuild
6 bin/jsbuild
View
@@ -192,10 +192,14 @@ var bundleRemote = function(file, i) {
bundle(i + 1)
}
client.get(options, function(response) {
+ if (response.statusCode < 200 || response.statusCode >= 300)
+ die('Request unsuccessful: ' + file)
+
response.addListener('data', function(c) { body += c.toString('utf8', 0, c.length) })
response.addListener('close', end)
response.addListener('end', end)
- }).on('error', function() {
+ })
+ .on('error', function() {
die('Request unsuccessful: ' + file)
})
}
Please sign in to comment.
Something went wrong with that request. Please try again.