Skip to content

Commit

Permalink
Use .exception() instead of manual traceback log
Browse files Browse the repository at this point in the history
  • Loading branch information
naglis authored and geigi committed Mar 1, 2024
1 parent 30c539f commit 7796bd9
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions cozy/media/importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 7796bd9

Please sign in to comment.