issue #24104: pass through error message
authorSteve Hackbarth <stephenhackbarth@gmail.com>
Thu, 17 Jul 2014 14:47:32 +0000 (10:47 -0400)
committerSteve Hackbarth <stephenhackbarth@gmail.com>
Thu, 17 Jul 2014 14:47:32 +0000 (10:47 -0400)
enyo-client/application/source/en/strings.js
enyo-client/application/source/ext/datasource.js
enyo-client/application/source/views/workspace.js
node-datasource/routes/install_extension.js

index 6f0c635..4e86c70 100644 (file)
     "_deleteLine?": "Are you sure you want to delete this line?",
     "_exitPageWarning": "You are about to leave the xTuple application.",
     "_installExtensionWarning": "Extensions are very powerful and potentially have full access to your " +
-      "data. You should only install an extension from a source you trust.",
+      "data. You should only install an extension from a source you trust. ",
     "_insufficientPrivileges": "You have insufficient privileges to perform this action.",
     "_manualFreight": "Manually editing the freight will disable automatic freight recalculations.",
     "_mustSave": "You must save your changes before proceeding.",
index 8a216b1..554e05f 100644 (file)
@@ -206,7 +206,7 @@ white:true*/
                   XM.jsonpatch.apply(attrs, data.patches);
                   cModel.etag = data.etag;
 
-                  // This is a hack to work around Backbone messing with 
+                  // This is a hack to work around Backbone messing with
                   // attributes when we don't want it to. Parse function
                   // on model handles the other side of this
                   options.fixAttributes = cModel.attributes;
@@ -259,7 +259,8 @@ white:true*/
       // handle error
       if (inResponse.isError) {
         if (inSender.error) {
-          params.error = inResponse.message;
+          // inResponse.message sometimes gets lost in the vagaries of socket-io
+          params.error = inResponse.message || inResponse.errorMessage;
           error = XT.Error.clone('xt1001', { params: params });
           inSender.error.call(this, error);
         }
index b5a1632..f301ee0 100644 (file)
@@ -463,7 +463,7 @@ strict: false*/
             },
             {
               success: function (message) {
-                that.doNotify({message: message.loc()});
+                that.doNotify({message: message && message.loc()});
               },
               error: function (error) {
                 that.doNotify({message: error.message ? error.message() : error});
index 6f9ce61..7a68505 100644 (file)
@@ -61,8 +61,8 @@ regexp:true, undef:true, strict:true, trailing:true, white:true */
       buildExtension
     ], function (err, results) {
       if (err) {
-        console.log(err);
         err.isError = true;
+        err.errorMessage = err.message;
         res.send(err);
         return;
       }