Improve error messages reported to the user in the case of finding an empty string.

This commit is contained in:
Pagan Gazzard 2015-04-15 17:13:15 +01:00 committed by Pablo Carranza Vélez
parent e38796e92a
commit a959660f90
2 changed files with 10 additions and 1 deletions

View File

@ -1,2 +1,3 @@
* Improved error messages reported to the user in the case of finding an empty string.
* Switched to using the dockerode pull progress mechanism. * Switched to using the dockerode pull progress mechanism.
* Fixed trying to delete supervisor container when it reports an alternate tag instead of the primary tag. * Fixed trying to delete supervisor container when it reports an alternate tag instead of the primary tag.

View File

@ -69,7 +69,15 @@ logSystemEvent = (logType, app, error) ->
message = "#{logType.humanName} '#{app.imageId}'" message = "#{logType.humanName} '#{app.imageId}'"
if error? if error?
# Report the message from the original cause to the user. # Report the message from the original cause to the user.
errMessage = error.cause?.json ? error.cause?.message ? error.message errMessage = error.cause?.json
if _.isEmpty(errMessage)
errMessage = error.cause?.reason
if _.isEmpty(errMessage)
errMessage = error.cause?.message
if _.isEmpty(errMessage)
errMessage = error.message
if _.isEmpty(errMessage)
errMessage = 'Unknown cause'
message += " due to '#{errMessage}'" message += " due to '#{errMessage}'"
logger.log({ message, isSystem: true }) logger.log({ message, isSystem: true })
utils.mixpanelTrack(logType.eventName, {app, error}) utils.mixpanelTrack(logType.eventName, {app, error})