Skip to content
Permalink
Browse files

[fix] move var decleration to beginning of function

  • Loading branch information...
Swaagie committed Mar 6, 2014
1 parent 58cb50d commit e96ee2fe8074afa5fa3a9d4c2980639dab268a4a
Showing with 5 additions and 3 deletions.
  1. +5 −3 node.js/lib/client/client.js
@@ -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 = '';

0 comments on commit e96ee2f

Please sign in to comment.
You can’t perform that action at this time.