 					'/var/run/docker.sock:/run/docker.sock'
 				]
 			)
-			# Bluebird throws OperationalError for errors resulting in the normal execution of a promisified function.
-			.catch Promise.OperationalError, (err) ->
-				# Report the message from the original cause to the user.
-				message = err.cause.json ? err.cause.message ? err.message
-				logSystemEvent("Unable to start application #{app.imageId} due to:\n#{message}")
-				# And rethrow the error, to be handled later as necessary.
+			.catch (err) ->
+				logSystemEvent(logTypes.startAppError, app, err)
 				throw err
 			.then ->
 				updateDeviceState(commit: app.commit)
 				logger.attach(app)
 	.tap ->
-		utils.mixpanelTrack('Application start', app.imageId)
-		logSystemEvent('Starting application ' + app.imageId)
+		logSystemEvent(logTypes.startAppSuccess, app)
 	.finally ->
 		updateDeviceState(status: 'Idle')
 

			return
		throw err
	.tap ->
		utils.mixpanelTrack('Application stop', app.imageId)
		knex('app').where('id', app.id).delete()

isValidPort = (port) ->

			else
				knex('app').insert(app)
		.tap (container) ->
			logSystemEvent(logTypes.startApp, app)
			updateDeviceState(status: 'Starting')
			ports = {}
			if portList?
