From 7796bd9ccf00212746f2c6ad8ee0309c782f9eb5 Mon Sep 17 00:00:00 2001 From: naglis <827324+naglis@users.noreply.github.com> Date: Fri, 9 Feb 2024 16:57:26 +0200 Subject: [PATCH] Use `.exception()` instead of manual traceback log --- cozy/media/importer.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/cozy/media/importer.py b/cozy/media/importer.py index 2d0a74e8..0009d8c9 100644 --- a/cozy/media/importer.py +++ b/cozy/media/importer.py @@ -2,7 +2,6 @@ import logging import os import time -import traceback from enum import Enum, auto from multiprocessing.pool import Pool as Pool from typing import List, Set @@ -115,9 +114,8 @@ def _execute_import(self, files_to_scan: List[str]) -> (Set[str], Set[str]): try: self._database_importer.insert_many(media_files) except Exception as e: - log.error("Error while inserting new tracks to the database") + log.exception("Error while inserting new tracks to the database") reporter.exception("importer", e) - log.error(traceback.format_exc()) self._toast.show("{}: {}".format(_("Error while importing new files"), str(e.__class__))) if self._progress >= self._files_count: