(status, message = undefined)
| 109 | }; |
| 110 | |
| 111 | const setFinalStatus = function (status, message = undefined) { |
| 112 | const finishedAt = new Date(); |
| 113 | const update = { status, finishedAt }; |
| 114 | if (message && typeof message === 'string') { |
| 115 | update.message = message; |
| 116 | } |
| 117 | if (Utils.isNativeError(message) && typeof message.message === 'string') { |
| 118 | update.message = message.message; |
| 119 | } |
| 120 | return handler.update({ objectId }, update); |
| 121 | }; |
| 122 | |
| 123 | return Object.freeze({ |
| 124 | setRunning, |
no test coverage detected