Merge pull request #1161 from balena-io/roman/errors

Add steps info to applyState error message
This commit is contained in:
Roman Mazur 2019-12-12 20:38:50 +02:00 committed by GitHub
commit 7e51d63380
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -440,6 +440,9 @@ module.exports = class DeviceState extends EventEmitter
.delay(nextDelay)
.then =>
@applyTarget({ force, initial, intermediate, skipLock, nextDelay, retryCount })
.catch (err) =>
detailedError = new Error('Failed to apply state transition steps. ' + err.message + ' Steps:' + JSON.stringify(_.map(steps, 'action')))
@applyError(detailedError, { force, initial, intermediate })
.catch (err) =>
@applyError(err, { force, initial, intermediate })