]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix feedback for sharing errors
authorMichael Gapczynski <GapczynskiM@gmail.com>
Sun, 6 May 2012 23:06:24 +0000 (19:06 -0400)
committerMichael Gapczynski <GapczynskiM@gmail.com>
Sun, 6 May 2012 23:06:24 +0000 (19:06 -0400)
apps/files_sharing/ajax/share.php
apps/files_sharing/js/share.js

index 79ebf9187b9c727c723f479b71c8e8b24f1f20bb..4478144e92f3df9b1005302f5324a3a4c578823c 100755 (executable)
@@ -22,12 +22,12 @@ foreach ($sources as $source) {
                                OCP\JSON::success();
                        }
                } catch (Exception $exception) {
-                       OCP\Util::writeLog('files_sharing', 'Unexpected Error : '.$exception->getMessage(),OCP\Util::ERROR);
-                       OCP\JSON::error();
+                       OCP\Util::writeLog('files_sharing', 'Unexpected Error : '.$exception->getMessage(), OCP\Util::ERROR);
+                       OCP\JSON::error(array('data' => array('message' => $exception->getMessage())));
                }
        } else {
-               OCP\Util::writeLog('files_sharing', 'File does not exist or is not readable :'.$source,OCP\Util::ERROR);
-               OCP\JSON::error();
+               OCP\Util::writeLog('files_sharing', 'File does not exist or is not readable :'.$source, OCP\Util::ERROR);
+               OCP\JSON::error(array('data' => array('message' => 'File does not exist or is not readable')));
        }
 }
 
index e9b46873d3a6f8b240cf6d34970551a7858c3b73..7bfaa1f0c69e0ead47f71bf3f723a83c143668c5 100644 (file)
@@ -35,7 +35,7 @@ OC.Share={
                                        callback(result.data);
                                }
                        } else {
-                               OC.dialogs.alert('Error', 'Error while sharing');
+                               OC.dialogs.alert(result.data.message, 'Error while sharing');
                        }
                });
        },