summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Tom Willemse2024-06-11 00:00:19 -0700
committerGravatar Tom Willemse2024-06-11 00:00:19 -0700
commit6e7fc03dd92f87477ac807519c48d0149b83c476 (patch)
treebdcdbaca97d8b7fe5da2858aa4135bff1dd923d0 /src
parenteb81d7b851f51ab5919be78493737ef2abf49aab (diff)
downloadscuttle-6e7fc03dd92f87477ac807519c48d0149b83c476.tar.gz
scuttle-6e7fc03dd92f87477ac807519c48d0149b83c476.zip
Throw an error if a bookmark can't be committed to the database
Diffstat (limited to 'src')
-rw-r--r--src/SemanticScuttle/Service/Bookmark.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/SemanticScuttle/Service/Bookmark.php b/src/SemanticScuttle/Service/Bookmark.php
index e157fc4..f617059 100644
--- a/src/SemanticScuttle/Service/Bookmark.php
+++ b/src/SemanticScuttle/Service/Bookmark.php
@@ -549,7 +549,15 @@ class SemanticScuttle_Service_Bookmark extends SemanticScuttle_DbService
'', __LINE__, __FILE__, $sql, $this->db
);
}
- $this->db->sql_transaction('commit');
+
+ if (!$this->db->sql_transaction('commit')) {
+ $this->db->sql_transaction('rollback');
+ message_die(
+ GENERAL_ERROR,
+ 'Could not commit bookmark',
+ '', __LINE__, __FILE__, $sql, $this->db
+ );
+ }
// Everything worked out, so return the new bookmark's bId.
return $bId;