mirror of
https://github.com/ansible/awx.git
synced 2026-03-18 17:37:30 -02:30
Adds error handling to launch api calls
This commit is contained in:
committed by
Jeff Bradberry
parent
1b94b616f0
commit
03c07c0843
@@ -56,7 +56,8 @@ function atLaunchTemplateCtrl (
|
|||||||
} else {
|
} else {
|
||||||
$state.go('output', { id: data.job, type: 'playbook' }, { reload: true });
|
$state.go('output', { id: data.job, type: 'playbook' }, { reload: true });
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
|
.catch(createErrorHandler('launch job template', 'POST'));
|
||||||
} else {
|
} else {
|
||||||
const promptData = {
|
const promptData = {
|
||||||
launchConf: launchData.data,
|
launchConf: launchData.data,
|
||||||
@@ -78,12 +79,14 @@ function atLaunchTemplateCtrl (
|
|||||||
});
|
});
|
||||||
promptData.surveyQuestions = processed.surveyQuestions;
|
promptData.surveyQuestions = processed.surveyQuestions;
|
||||||
vm.promptData = promptData;
|
vm.promptData = promptData;
|
||||||
});
|
})
|
||||||
|
.catch(createErrorHandler('get survey questions', 'GET'));
|
||||||
} else {
|
} else {
|
||||||
vm.promptData = promptData;
|
vm.promptData = promptData;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
|
.catch(createErrorHandler('get launch options', 'GET'));
|
||||||
} else if (vm.template.type === 'workflow_job_template') {
|
} else if (vm.template.type === 'workflow_job_template') {
|
||||||
const selectedWorkflowJobTemplate = workflowTemplate.create();
|
const selectedWorkflowJobTemplate = workflowTemplate.create();
|
||||||
const preLaunchPromises = [
|
const preLaunchPromises = [
|
||||||
@@ -99,7 +102,8 @@ function atLaunchTemplateCtrl (
|
|||||||
.postLaunch({ id: vm.template.id })
|
.postLaunch({ id: vm.template.id })
|
||||||
.then(({ data }) => {
|
.then(({ data }) => {
|
||||||
$state.go('workflowResults', { id: data.workflow_job }, { reload: true });
|
$state.go('workflowResults', { id: data.workflow_job }, { reload: true });
|
||||||
});
|
})
|
||||||
|
.catch(createErrorHandler('launch workflow job template', 'POST'));
|
||||||
} else {
|
} else {
|
||||||
launchData.data.defaults.extra_vars = wfjtData.data.extra_vars;
|
launchData.data.defaults.extra_vars = wfjtData.data.extra_vars;
|
||||||
|
|
||||||
@@ -128,7 +132,8 @@ function atLaunchTemplateCtrl (
|
|||||||
vm.promptData = promptData;
|
vm.promptData = promptData;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
|
.catch(createErrorHandler('get launch options', 'GET'));
|
||||||
} else {
|
} else {
|
||||||
Alert(templatesStrings.get('error.UNKNOWN'), templatesStrings.get('alert.UNKNOWN_LAUNCH'));
|
Alert(templatesStrings.get('error.UNKNOWN'), templatesStrings.get('alert.UNKNOWN_LAUNCH'));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user