diff --git a/core/ajax/share.php b/core/ajax/share.php
index 6f5b927c779e24fadbaf274a8f2d667d9193167c..f7a41aa3a4a9e3a4e9696680081c0f193088ef20 100644
--- a/core/ajax/share.php
+++ b/core/ajax/share.php
@@ -25,9 +25,13 @@ if (isset($_POST['action']) && isset($_POST['itemType']) && isset($_POST['item']
 	switch ($_POST['action']) {
 		case 'share':
 			if (isset($_POST['shareType']) && isset($_POST['shareWith']) && isset($_POST['permissions'])) {
-				$return = OCP\Share::share($_POST['itemType'], $_POST['item'], $_POST['shareType'], $_POST['shareWith'], $_POST['permissions']);
-				// TODO May need to return private link
-				($return) ? OC_JSON::success() : OC_JSON::error();
+				try {
+					OCP\Share::share($_POST['itemType'], $_POST['item'], $_POST['shareType'], $_POST['shareWith'], $_POST['permissions']);
+					// TODO May need to return private link
+					OC_JSON::success();
+				} catch (Exception $exception) {
+					OC_JSON::error(array('data' => array('message' => $exception->getMessage())));
+				}
 			}
 			break;
 		case 'unshare':
diff --git a/core/js/share.js b/core/js/share.js
index 5832acfd4548db377beef1534d7c6613233a06aa..a3fe0f697320e3e31544ce410e0ad9d63a17bd95 100644
--- a/core/js/share.js
+++ b/core/js/share.js
@@ -47,7 +47,7 @@ OC.Share={
 					callback(result.data);
 				}
 			} else {
-				OC.dialogs.alert('Error', 'Error while sharing');
+				OC.dialogs.alert(result.data.message, 'Error while sharing');
 			}
 		});
 	},
diff --git a/lib/public/share.php b/lib/public/share.php
index d9bcb8df81f83af2925a1630e236f562089dd5b1..3cc755866e321b80913fc16d79eb1bc7b884be36 100644
--- a/lib/public/share.php
+++ b/lib/public/share.php
@@ -156,27 +156,32 @@ class Share {
 		switch ($shareType) {
 			case self::SHARE_TYPE_USER:
 				if ($shareWith == $uidOwner) {
-					\OC_Log::write('OCP\Share', 'Sharing '.$item.' failed, because the user '.$shareWith.' is the item owner', \OC_Log::ERROR);
-					return false;
+					$message = 'Sharing '.$item.' failed, because the user '.$shareWith.' is the item owner';
+					\OC_Log::write('OCP\Share', $message, \OC_Log::ERROR);
+					throw new \Exception($message);
 				}
 				if (!\OC_User::userExists($shareWith)) {
-					\OC_Log::write('OCP\Share', 'Sharing '.$item.' failed, because the user '.$shareWith.' does not exist', \OC_Log::ERROR);
-					return false;
+					$message = 'Sharing '.$item.' failed, because the user '.$shareWith.' does not exist';
+					\OC_Log::write('OCP\Share', $message, \OC_Log::ERROR);
+					throw new \Exception($message);
 				} else {
 					$inGroup = array_intersect(\OC_Group::getUserGroups($uidOwner), \OC_Group::getUserGroups($shareWith));
 					if (empty($inGroup)) {
-						\OC_Log::write('OCP\Share', 'Sharing '.$item.' failed, because the user '.$shareWith.' is not a member of any groups that '.$uidOwner.' is a member of', \OC_Log::ERROR);
-						return false;
+						$message = 'Sharing '.$item.' failed, because the user '.$shareWith.' is not a member of any groups that '.$uidOwner.' is a member of';
+						\OC_Log::write('OCP\Share', $message, \OC_Log::ERROR);
+						throw new \Exception($message);
 					}
 				}
 				break;
 			case self::SHARE_TYPE_GROUP:
 				if (!\OC_Group::groupExists($shareWith)) {
-					\OC_Log::write('OCP\Share', 'Sharing '.$item.' failed, because the group '.$shareWith.' does not exist', \OC_Log::ERROR);
-					return false;
+					$message = 'Sharing '.$item.' failed, because the group '.$shareWith.' does not exist';
+					\OC_Log::write('OCP\Share', $message, \OC_Log::ERROR);
+					throw new \Exception($message);
 				} else if (!\OC_Group::inGroup($uidOwner, $shareWith)) {
-					\OC_Log::write('OCP\Share', 'Sharing '.$item.' failed, because '.$uidOwner.' is not a member of the group '.$shareWith, \OC_Log::ERROR);
-					return false;
+					$message = 'Sharing '.$item.' failed, because '.$uidOwner.' is not a member of the group '.$shareWith;
+					\OC_Log::write('OCP\Share', $message, \OC_Log::ERROR);
+					throw new \Exception($message);
 				}
 				// Convert share with into an array with the keys group and users
 				$group = $shareWith;
@@ -189,19 +194,22 @@ class Share {
 				return self::put($itemType, $item, $shareType, $shareWith, $uidOwner, $permissions);
 			case self::SHARE_TYPE_CONTACT:
 				if (!\OC_App::isEnabled('contacts')) {
-					\OC_Log::write('OCP\Share', 'Sharing '.$item.' failed, because the contacts app is not enabled', \OC_Log::ERROR);
+					$message = 'Sharing '.$item.' failed, because the contacts app is not enabled';
+					\OC_Log::write('OCP\Share', $message, \OC_Log::ERROR);
 					return false;
 				}
 				$vcard = \OC_Contacts_App::getContactVCard($shareWith);
 				if (!isset($vcard)) {
-					\OC_Log::write('OCP\Share', 'Sharing '.$item.' failed, because the contact does not exist', \OC_Log::ERROR);
-					return false;
+					$message = 'Sharing '.$item.' failed, because the contact does not exist';
+					\OC_Log::write('OCP\Share', $message, \OC_Log::ERROR);
+					throw new \Exception($message);
 				}
 				$details = OC_Contacts_VCard::structureContact($vcard);
 				// TODO Add ownCloud user to contacts vcard
 				if (!isset($details['EMAIL'])) {
-					\OC_Log::write('OCP\Share', 'Sharing '.$item.' failed, because no email address is associated with the contact', \OC_Log::ERROR);
-					return false;
+					$message = 'Sharing '.$item.' failed, because no email address is associated with the contact';
+					\OC_Log::write('OCP\Share', $message, \OC_Log::ERROR);
+					throw new \Exception($message);
 				}
 				return self::share($itemType, $item, self::SHARE_TYPE_EMAIL, $permissions);
 				break;
@@ -211,8 +219,9 @@ class Share {
 				return false;
 		}
 		if (self::getItems($itemType, $item, $shareType, $shareWith, $uidOwner, self::FORMAT_NONE, null, 1)) {
-			\OC_Log::write('OCP\Share', 'Sharing '.$item.' failed, because this item is already shared with '.$shareWith, \OC_Log::ERROR);
-			return false;
+			$message = 'Sharing '.$item.' failed, because this item is already shared with '.$shareWith;
+			\OC_Log::write('OCP\Share', $message, \OC_Log::ERROR);
+			throw new \Exception($message);
 		}
 		if ($collectionTypes = self::getCollectionItemTypes($itemType)) {
 			foreach ($collectionTypes as $collectionType) {