diff --git a/src/sunstone/public/app/utils/vcenter/datastores.js b/src/sunstone/public/app/utils/vcenter/datastores.js index 14f9172d98..956d25f3f2 100644 --- a/src/sunstone/public/app/utils/vcenter/datastores.js +++ b/src/sunstone/public/app/utils/vcenter/datastores.js @@ -180,7 +180,11 @@ define(function(require) { $("#get-vcenter-ds").click(); }, error: function (request, error_json) { - Notifier.notifyError(request.responseJSON.error.message); + if (request.responseJSON === undefined){ + Notifier.notifyError("Empty response received from server. Check your setup to avoid timeouts"); + } else { + Notifier.notifyError(request.responseJSON.error.message); + } $("#get-vcenter-ds").click(); } }); diff --git a/src/sunstone/public/app/utils/vcenter/images.js b/src/sunstone/public/app/utils/vcenter/images.js index 6b9b784dee..a85ed432fc 100644 --- a/src/sunstone/public/app/utils/vcenter/images.js +++ b/src/sunstone/public/app/utils/vcenter/images.js @@ -176,7 +176,11 @@ define(function(require) { $("#get-vcenter-images").click(); }, error: function (request, error_json) { - Notifier.notifyError(request.responseJSON.error.message); + if (request.responseJSON === undefined){ + Notifier.notifyError("Empty response received from server. Check your setup to avoid timeouts"); + } else { + Notifier.notifyError(request.responseJSON.error.message); + } $("#get-vcenter-images").click(); } }); diff --git a/src/sunstone/public/app/utils/vcenter/networks.js b/src/sunstone/public/app/utils/vcenter/networks.js index bf7d35aaec..15a2eaa26f 100644 --- a/src/sunstone/public/app/utils/vcenter/networks.js +++ b/src/sunstone/public/app/utils/vcenter/networks.js @@ -302,7 +302,11 @@ define(function(require) { $("#get-vcenter-networks").click(); }, error: function(request, error_json){ - Notifier.notifyError(request.responseJSON.error.message); + if (request.responseJSON === undefined){ + Notifier.notifyError("Empty response received from server. Check your setup to avoid timeouts"); + } else { + Notifier.notifyError(request.responseJSON.error.message); + } $("#get-vcenter-networks").click(); } }); diff --git a/src/sunstone/public/app/utils/vcenter/templates.js b/src/sunstone/public/app/utils/vcenter/templates.js index d1f541a56e..c9cc1391a5 100644 --- a/src/sunstone/public/app/utils/vcenter/templates.js +++ b/src/sunstone/public/app/utils/vcenter/templates.js @@ -250,7 +250,11 @@ define(function(require) { $("#get-vcenter-templates").click(); }, error: function(request, error_json){ - Notifier.notifyError(request.responseJSON.error.message); + if (request.responseJSON === undefined){ + Notifier.notifyError("Empty response received from server. Check your setup to avoid timeouts"); + } else { + Notifier.notifyError(request.responseJSON.error.message); + } $("#get-vcenter-templates").click(); } });