Don't wrap UpdatesLockedErrors with a detailed error

Change-type: patch
Signed-off-by: Cameron Diver <cameron@balena.io>
This commit is contained in:
Cameron Diver 2020-04-01 16:04:47 +01:00
parent eca8fc9208
commit dda6270219

View File

@ -774,17 +774,16 @@ export class DeviceState extends (EventEmitter as new () => DeviceStateEventEmit
retryCount,
});
} catch (e) {
const detailedError = new Error(
if (e instanceof UpdatesLockedError) {
// Forward the UpdatesLockedError directly
throw e;
}
throw new Error(
'Failed to apply state transition steps. ' +
e.message +
' Steps:' +
JSON.stringify(_.map(steps, 'action')),
);
return this.applyError(detailedError, {
force,
initial,
intermediate,
});
}
}).catch(err => {
return this.applyError(err, { force, initial, intermediate });