From 883d2c01051134647ee50b8d57b6abcafb66bbd7 Mon Sep 17 00:00:00 2001 From: cage Date: Mon, 24 Jun 2024 12:18:06 +0200 Subject: [PATCH] - [TUI] notify when a parsing error occurred when querying local database. --- src/program-events.lisp | 49 +++++++++++++++++++++-------------------- 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/src/program-events.lisp b/src/program-events.lisp index 9f16c51..038abab 100644 --- a/src/program-events.lisp +++ b/src/program-events.lisp @@ -2038,30 +2038,31 @@ (defmethod process-event ((object fediverse-local-query-event)) (with-accessors ((payload payload)) object - (multiple-value-bind (statuses destination-folder) - (fediverse-post-local-search:parse-search-statuses payload) - (let ((folder (or destination-folder - (query-results-folder-name)))) - (loop for status in statuses do - (let* ((status-id (db:row-message-status-id status)) - (status-row (db:find-status-id status-id))) - (when (not (db::find-status-id-folder-timeline status-id - folder - db:+home-timeline+)) - (setf (getf status-row :folder) - folder) - (setf (getf status-row :timeline) - db:+home-timeline+) - (multiple-value-bind (query column-values) - (db-utils:insert-query db:+table-status+ status-row) - (db-utils:query-low-level query column-values))))) - (db:renumber-timeline-message-index db:+home-timeline+ - folder - :account-id nil) - (let ((refresh-event (make-instance 'refresh-thread-windows-event - :new-folder folder - :new-timeline db:+home-timeline+))) - (push-event refresh-event)))))) + (tui-utils:with-notify-errors + (multiple-value-bind (statuses destination-folder) + (fediverse-post-local-search:parse-search-statuses payload) + (let ((folder (or destination-folder + (query-results-folder-name)))) + (loop for status in statuses do + (let* ((status-id (db:row-message-status-id status)) + (status-row (db:find-status-id status-id))) + (when (not (db::find-status-id-folder-timeline status-id + folder + db:+home-timeline+)) + (setf (getf status-row :folder) + folder) + (setf (getf status-row :timeline) + db:+home-timeline+) + (multiple-value-bind (query column-values) + (db-utils:insert-query db:+table-status+ status-row) + (db-utils:query-low-level query column-values))))) + (db:renumber-timeline-message-index db:+home-timeline+ + folder + :account-id nil) + (let ((refresh-event (make-instance 'refresh-thread-windows-event + :new-folder folder + :new-timeline db:+home-timeline+))) + (push-event refresh-event))))))) ;;;; end events