From 36e63862e5c16235dbc6f12c649df67e44337b04 Mon Sep 17 00:00:00 2001 From: Jared Tabor Date: Fri, 28 Aug 2015 13:15:39 -0700 Subject: [PATCH] catch possible 404 error on dashboard --- .../graphs/job-status/job-status-graph.service.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/awx/ui/client/src/dashboard/graphs/job-status/job-status-graph.service.js b/awx/ui/client/src/dashboard/graphs/job-status/job-status-graph.service.js index 4f659a511b..26b5b89029 100644 --- a/awx/ui/client/src/dashboard/graphs/job-status/job-status-graph.service.js +++ b/awx/ui/client/src/dashboard/graphs/job-status/job-status-graph.service.js @@ -21,7 +21,18 @@ function JobStatusGraphData(Rest, getBasePath, processErrors, $rootScope, $q) { } function getData(period, jobType) { - var url = getBasePath('dashboard')+'graphs/jobs/?period='+period+'&job_type='+jobType; + var url, dash_path = getBasePath('dashboard'); + if(dash_path === '' ){ + processErrors(null, + null, + null, + null, { + hdr: 'Error!', + msg: "There was an error. Please try again." + }); + return; + } + url = dash_path + 'graphs/jobs/?period='+period+'&job_type='+jobType; Rest.setUrl(url); var result = Rest.get() .catch(function(response) {