diff --git a/package.json b/package.json index e0557747..8f787eb5 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "dependencies": { "JSONStream": "^0.10.0", "blinking": "~0.0.2", - "bluebird": "^2.6.0", + "bluebird": "^2.9.24", "body-parser": "^1.12.0", "coffee-script": "~1.9.1", "dockerode": "~2.1.1", diff --git a/src/application.coffee b/src/application.coffee index a1afcabf..6af77c94 100644 --- a/src/application.coffee +++ b/src/application.coffee @@ -69,11 +69,9 @@ logSystemEvent = (logType, app, error) -> message = "#{logType.humanName} '#{app.imageId}'" if error? # Report the message from the original cause to the user. - errMessage = error.cause?.json + errMessage = error.json if _.isEmpty(errMessage) - errMessage = error.cause?.reason - if _.isEmpty(errMessage) - errMessage = error.cause?.message + errMessage = error.reason if _.isEmpty(errMessage) errMessage = error.message if _.isEmpty(errMessage) @@ -99,7 +97,7 @@ kill = (app) -> .catch Promise.OperationalError, (err) -> # Get the statusCode from the original cause and make sure statusCode its definitely a string for comparison # reasons. - statusCode = '' + err.cause.statusCode + statusCode = '' + err.statusCode # 304 means the container was already stopped - so we can just remove it if statusCode is '304' return container.removeAsync() @@ -212,7 +210,7 @@ exports.start = start = (app) -> ] ) .catch (err) -> - statusCode = '' + err.cause?.statusCode + statusCode = '' + err.statusCode # 304 means the container was already started, precisely what we want :) if statusCode is '304' return