Skip to content

Commit

Permalink
[fix] move var decleration to beginning of function
Browse files Browse the repository at this point in the history
  • Loading branch information
Swaagie committed Mar 6, 2014
1 parent 58cb50d commit e96ee2f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions node.js/lib/client/client.js
Expand Up @@ -280,13 +280,15 @@ Client.prototype.upload = function (options, callback) {

req.on('error', callback);
req.on('response', function (res) {
var statusCode = res.statusCode,
error;

//
// TODO: clean this up. This is an extraneous case that offsets the main
// use case of the api so we repeat some code here
//
if (failCodes[res.statusCode]) {
var statusCode = res.statusCode,
error = new Error('Nodejitsu Error (' + statusCode + '): ' + failCodes[statusCode]);
if (failCodes[statusCode]) {
error = new Error('Nodejitsu Error (' + statusCode + '): ' + failCodes[statusCode]);

error.statusCode = statusCode;
error.result = '';
Expand Down

0 comments on commit e96ee2f

Please sign in to comment.