Throw error object and not a string
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user