diff options
author | Tom Willemse | 2024-06-11 00:00:19 -0700 |
---|---|---|
committer | Tom Willemse | 2024-06-11 00:00:19 -0700 |
commit | 6e7fc03dd92f87477ac807519c48d0149b83c476 (patch) | |
tree | bdcdbaca97d8b7fe5da2858aa4135bff1dd923d0 /src/SemanticScuttle/Service | |
parent | eb81d7b851f51ab5919be78493737ef2abf49aab (diff) | |
download | scuttle-6e7fc03dd92f87477ac807519c48d0149b83c476.tar.gz scuttle-6e7fc03dd92f87477ac807519c48d0149b83c476.zip |
Throw an error if a bookmark can't be committed to the database
Diffstat (limited to 'src/SemanticScuttle/Service')
-rw-r--r-- | src/SemanticScuttle/Service/Bookmark.php | 10 |
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; |