Skip to content

Commit

Permalink
Merge branch 'master' of github.com:nodejitsu/jitsu
Browse files Browse the repository at this point in the history
  • Loading branch information
bmeck committed Aug 9, 2011
2 parents 81cf0dd + 69e0770 commit bc9e08f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/jitsu/api/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,14 @@ Client.prototype.request = function (method, uri /* variable arguments */) {
catch (ex) {
// Ignore Errors
}


if (response.headers['x-powered-by'] !== 'Nodejitsu') {
error = new Error('Jitsu requires you to connect to Nodejitsu\'s stack (api.nodejitsu.com)');
error.statusCode = "403";
error.result = "";
return callback(error);
}

if (Object.keys(jitsu.failCodes).indexOf(statusCode) !== -1) {
error = new Error('Nodejitsu Error (' + statusCode + '): ' + jitsu.failCodes[statusCode]);
error.statusCode = statusCode;
Expand Down Expand Up @@ -122,7 +129,6 @@ Client.prototype.upload = function (uri, contentType, file, callback, success) {
catch (ex) {
// Ignore Errors
}

if (Object.keys(jitsu.failCodes).indexOf(statusCode) !== -1) {
error = new Error('Nodejitsu Error (' + statusCode + '): ' + jitsu.failCodes[statusCode]);
error.result = result;
Expand Down

0 comments on commit bc9e08f

Please sign in to comment.