Throw error object and not a string

This commit is contained in:
Girish Ramakrishnan
2020-03-03 11:07:56 -08:00
parent 3cb15f0097
commit fb5e2ef671
2 changed files with 4 additions and 4 deletions

View File

@@ -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;