From 93bc3f70941370389d1dc2383a167eca697cc050 Mon Sep 17 00:00:00 2001
From: Daniel Molina <dmolina@opennebula.org>
Date: Tue, 23 Sep 2014 16:49:58 +0200
Subject: [PATCH] feature #3194: Fix upload error message format

---
 src/sunstone/public/js/plugins/files-tab.js  | 3 +--
 src/sunstone/public/js/plugins/images-tab.js | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/sunstone/public/js/plugins/files-tab.js b/src/sunstone/public/js/plugins/files-tab.js
index 151b0f0c80..6c7e6a2c4c 100644
--- a/src/sunstone/public/js/plugins/files-tab.js
+++ b/src/sunstone/public/js/plugins/files-tab.js
@@ -679,8 +679,7 @@ function setupCreateFileDialog(){
                 Sunstone.runAction("Image.refresh");
             },
             error: function(response){
-                //onError({}, JSON.parse(response) );
-                notifyMessage(response);
+                onError({}, OpenNebula.Error(response));
                 $('div[id="file-'+fileName+'-progressBar"]').remove();
             }
         });
diff --git a/src/sunstone/public/js/plugins/images-tab.js b/src/sunstone/public/js/plugins/images-tab.js
index 73e86449c8..71b99a78fe 100644
--- a/src/sunstone/public/js/plugins/images-tab.js
+++ b/src/sunstone/public/js/plugins/images-tab.js
@@ -981,8 +981,7 @@ function initialize_create_image_dialog(dialog) {
                 Sunstone.runAction("Image.refresh");
             },
             error: function(response){
-                //onError({}, JSON.parse(response) );
-                notifyMessage(response);
+                onError({}, OpenNebula.Error(response));
                 $('div[id="'+fileName+'progressBar"]').remove();
             }
         });