           group-name     (db-interface/read-group-name group-id)
           component-list (db-interface/read-components group-id)]
           (if delete-result
-              (finish-processing html-renderer/render-component-list request title product-id chapter-id group-id product-name chapter-name group-name component-list "danger" (.getMessage delete-result))
+              (finish-processing html-renderer/render-component-list request title product-id chapter-id group-id product-name chapter-name group-name component-list "danger" (utils/get-exception-message delete-result))
               (finish-processing html-renderer/render-component-list request title product-id chapter-id group-id product-name chapter-name group-name component-list "info" (str "Component " component-name " has been deleted")))))
 
 (defn get-output-format

        (if entered-name
            (cond
                (empty? entered-name) (finish-processing html-renderer/render-edit-chapter request title product-id product-name chapter-id chapter-name "danger" "Chapter name is not specified")
                update-result         (finish-processing html-renderer/render-edit-chapter request title product-id product-name chapter-id chapter-name "danger" (.getMessage update-result))
                :else                 (finish-processing html-renderer/render-edit-chapter request title product-id product-name chapter-id chapter-name "info"   "Chapter has been renamed"))
            (finish-processing html-renderer/render-edit-chapter request title product-id product-name chapter-id chapter-name))))


                       groups-per-chapter (db-interface/read-groups-per-chapter product-id chapter-list)]
                       (cond
                           (empty? group-name) (finish-processing html-renderer/render-chapter-list request title product-id product-name chapter-list groups-per-chapter "danger" "Group name is not specified")
                           insert-result       (finish-processing html-renderer/render-chapter-list request title product-id product-name chapter-list groups-per-chapter "danger" (utils/get-exception-message insert-result))
                           :else               (finish-processing html-renderer/render-chapter-list request title product-id product-name chapter-list groups-per-chapter "info"   (str "Group " group-name " has been added into the database"))
                       ))
                  (let [chapter-name   (db-interface/read-chapter-name chapter-id)
                        group-list     (db-interface/read-groups chapter-id)]
                       (cond
                           (empty? group-name) (finish-processing html-renderer/render-group-list request title product-id chapter-id product-name chapter-name group-list "danger" "Group name is not specified")
                           insert-result       (finish-processing html-renderer/render-group-list request title product-id chapter-id product-name chapter-name group-list "danger" (utils/get-exception-message insert-result))
                           :else               (finish-processing html-renderer/render-group-list request title product-id chapter-id product-name chapter-name group-list "info"   (str "Group " group-name " has been added into the database"))
                       ))))))

