Skip to content

Commit

Permalink
Be ok with 204.
Browse files Browse the repository at this point in the history
  • Loading branch information
willwhite committed Mar 4, 2014
1 parent 046d437 commit 1829cae
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions commands/export.bones
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ command.prototype.upload = function (callback) {
}, function(err, resp, body) {
if (err) throw err;
if (resp.statusCode !== 200)
throw new Error('MapBox Hosting is not available. Status ' + resp.statusCode + '.');
throw new Error('Status ' + resp.statusCode + ' from Mapbox');

// Let Step catch thrown errors here.
uploadArgs = JSON.parse(body);
Expand Down Expand Up @@ -658,7 +658,7 @@ command.prototype.upload = function (callback) {
if (err) {
return this(new Error('Connection terminated. Code ' + err.code));
}
if (resp.statusCode !== 303) {
if (resp.statusCode !== 303 && resp.statusCode !== 204) {
var parsed = _({
code: new RegExp('[^>]+(?=<\\/Code>)', 'g'),
message: new RegExp('[^>]+(?=<\\/Message>)', 'g')
Expand All @@ -673,7 +673,7 @@ command.prototype.upload = function (callback) {
}
this();
}.bind(this);
resp.on('data', function(chunk) { chunk += data; });
resp.on('data', function(chunk) { data += chunk; });
resp.on('close', callback);
resp.on('end', callback);
}.bind(this));
Expand Down

0 comments on commit 1829cae

Please sign in to comment.