function setResult(result, message) {
    debug('task result: ' + TaskResult[result]);
    command('task.complete', { 'result': TaskResult[result] }, message);
    if (result == TaskResult.Failed) {
        _writeError(message);
    }
    if (result == TaskResult.Failed) {
        process.exit(0);
    }
}