diff --git a/src/js/setupdns.js b/src/js/setupdns.js index 5e21c9102..433af81f1 100644 --- a/src/js/setupdns.js +++ b/src/js/setupdns.js @@ -167,10 +167,10 @@ app.controller('SetupDNSController', ['$scope', '$http', '$timeout', 'Client', f }; if (!config.projectId || !config.credentials || !config.credentials.client_email || !config.credentials.private_key) { - throw 'fields_missing'; + throw new Error('One or more fields are missing in the JSON'); } - } catch(e) { - $scope.error.dnsCredentials = 'Cannot parse Google Service Account Key'; + } catch (e) { + $scope.error.dnsCredentials = 'Cannot parse Google Service Account Key: ' + e.message; $scope.dnsCredentials.busy = false; return; } diff --git a/src/views/domains.js b/src/views/domains.js index 441342c71..e78b26a50 100644 --- a/src/views/domains.js +++ b/src/views/domains.js @@ -217,7 +217,7 @@ angular.module('Application').controller('DomainsController', ['$scope', '$locat }; if (!data.projectId || !data.credentials || !data.credentials.client_email || !data.credentials.private_key) { - throw 'fields_missing'; + throw new Error('One or more fields are missing in the JSON'); } } catch (e) { $scope.domainConfigure.error = 'Cannot parse Google Service Account Key: ' + e.message;