@@ -364,7 +364,7 @@ public override Topic Load(string topicKey = null, bool isRecursive = true) {
364364 | Catch exception
365365 \-----------------------------------------------------------------------------------------------------------------------*/
366366 catch ( SqlException exception ) {
367- throw new Exception ( $ "Topic(s) failed to load: '{ exception . Message } '") ;
367+ throw new TopicRepositoryException ( $ "Topic(s) failed to load: '{ exception . Message } '", exception ) ;
368368 }
369369
370370 /*------------------------------------------------------------------------------------------------------------------------
@@ -503,7 +503,7 @@ public override Topic Load(int topicId, bool isRecursive = true) {
503503 | Catch exception
504504 \-----------------------------------------------------------------------------------------------------------------------*/
505505 catch ( SqlException exception ) {
506- throw new Exception ( $ "Topics failed to load: '{ exception . Message } '") ;
506+ throw new TopicRepositoryException ( $ "Topics failed to load: '{ exception . Message } '", exception ) ;
507507 }
508508
509509 /*------------------------------------------------------------------------------------------------------------------------
@@ -638,7 +638,7 @@ public override Topic Load(int topicId, DateTime version) {
638638 | Catch exception
639639 \-----------------------------------------------------------------------------------------------------------------------*/
640640 catch ( SqlException exception ) {
641- throw new Exception ( $ "Topics failed to load: '{ exception . Message } '") ;
641+ throw new TopicRepositoryException ( $ "Topics failed to load: '{ exception . Message } '", exception ) ;
642642 }
643643
644644 /*------------------------------------------------------------------------------------------------------------------------
@@ -846,8 +846,9 @@ public override int Save(Topic topic, bool isRecursive = false, bool isDraft = f
846846 | Catch exception
847847 \-----------------------------------------------------------------------------------------------------------------------*/
848848 catch ( SqlException exception ) {
849- throw new Exception (
850- $ "Failed to save Topic '{ topic . Key } ' ({ topic . Id } ) via '{ _connectionString } ': '{ exception . Message } '"
849+ throw new TopicRepositoryException (
850+ $ "Failed to save Topic '{ topic . Key } ' ({ topic . Id } ) via '{ _connectionString } ': '{ exception . Message } '",
851+ exception
851852 ) ;
852853 }
853854
@@ -934,8 +935,9 @@ public override void Move(Topic topic, Topic target, Topic sibling) {
934935 | Catch exception
935936 \-----------------------------------------------------------------------------------------------------------------------*/
936937 catch ( SqlException exception ) {
937- throw new Exception (
938- $ "Failed to move Topic '{ topic . Key } ' ({ topic . Id } ) to '{ target . Key } ' ({ target . Id } ): '{ exception . Message } '"
938+ throw new TopicRepositoryException (
939+ $ "Failed to move Topic '{ topic . Key } ' ({ topic . Id } ) to '{ target . Key } ' ({ target . Id } ): '{ exception . Message } '",
940+ exception
939941 ) ;
940942 }
941943
@@ -1003,7 +1005,10 @@ public override void Delete(Topic topic, bool isRecursive = false) {
10031005 | Catch exception
10041006 \-----------------------------------------------------------------------------------------------------------------------*/
10051007 catch ( SqlException exception ) {
1006- throw new Exception ( $ "Failed to delete Topic '{ topic . Key } ' ({ topic . Id } ): '{ exception . Message } '") ;
1008+ throw new TopicRepositoryException (
1009+ $ "Failed to delete Topic '{ topic . Key } ' ({ topic . Id } ): '{ exception . Message } '",
1010+ exception
1011+ ) ;
10071012 }
10081013
10091014 /*------------------------------------------------------------------------------------------------------------------------
@@ -1098,7 +1103,10 @@ private static string PersistRelations(Topic topic, SqlConnection connection, bo
10981103 | Catch exception
10991104 \-----------------------------------------------------------------------------------------------------------------------*/
11001105 catch ( SqlException exception ) {
1101- throw new Exception ( $ "Failed to persist relationships for Topic '{ topic . Key } ' ({ topic . Id } ): '{ exception . Message } '") ;
1106+ throw new TopicRepositoryException (
1107+ $ "Failed to persist relationships for Topic '{ topic . Key } ' ({ topic . Id } ): '{ exception . Message } '",
1108+ exception
1109+ ) ;
11021110 }
11031111
11041112 /*------------------------------------------------------------------------------------------------------------------------
0 commit comments