Skip to content

fix: Combine logger exception/warning messages - #721

Merged
luisremis merged 4 commits into
developfrom
fix/issue-408
May 21, 2026
Merged

luisremis merged 4 commits into
developfrom
fix/issue-408

Conversation

@ad-claw000

Copy link
Copy Markdown
Contributor

Summary

This PR combines redundant logger calls in exception handlers into single logger.exception calls, avoiding duplicate exception logging. It also removes the redundant {e=} inside format strings where exc_info=True is already provided.

Verification

Checked that the syntax is correct and logs the exception alongside the error message without duplicating the exception trace or object string.

Fixes #408

Copilot AI review requested due to automatic review settings May 20, 2026 11:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR reduces duplicate exception logging by consolidating paired logger.error/logger.warning + logger.exception calls into single exception-aware log calls, and removes redundant exception string interpolation where exc_info is already emitted.

Changes:

  • Replaced redundant two-line exception logging patterns with single logger.exception(...) calls across several modules.
  • Removed redundant {e=} inclusion in a connection error message where exc_info=True is already provided.
  • Adjusted a CLI FUSE mount error handler to log via a single logger.exception(...) call.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
aperturedb/VideoDataCSV.py Consolidates duplicate error + exception logging for video load failures.
aperturedb/Sources.py Consolidates validation error logging in file load exception handler.
aperturedb/ImageDownloader.py Consolidates image download/decode exception logging (notably for GET connection failures).
aperturedb/ImageDataCSV.py Consolidates duplicate error + exception logging for image load failures.
aperturedb/Connector.py Removes redundant exception interpolation from a connection error log while keeping exc_info=True.
aperturedb/cli/mount_coco.py Consolidates exception logging in FUSE read path.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread aperturedb/Sources.py Resolved
Comment thread aperturedb/ImageDownloader.py Resolved
Comment thread aperturedb/ImageDownloader.py Resolved
Comment thread aperturedb/cli/mount_coco.py Resolved
Comment thread aperturedb/cli/mount_coco.py Resolved
Copilot AI review requested due to automatic review settings May 21, 2026 04:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.

Comments suppressed due to low confidence (2)

aperturedb/ImageDownloader.py:113

  • requests.exceptions.ConnectionError is caught as e but the variable is unused. Consider switching to except requests.exceptions.ConnectionError: since you’re logging with exc_info=True already.
            except requests.exceptions.ConnectionError as e:
                logger.warning("Error with GET.", exc_info=True)

aperturedb/ImageDownloader.py:138

  • The exception is captured as e but not used after switching to logger.exception(...). Consider changing this to except Exception:.
            except Exception as e:
                logger.exception(f"Downloaded image cannot be decoded: {url}")
                os.remove(filename)
                self.error_counter += 1

Comment thread aperturedb/VideoDataCSV.py Resolved
Comment thread aperturedb/ImageDataCSV.py Resolved
Comment thread aperturedb/Sources.py Resolved
Comment thread aperturedb/ImageDownloader.py Resolved
Comment thread aperturedb/cli/mount_coco.py Resolved
Comment thread aperturedb/Connector.py Resolved
@luisremis
luisremis merged commit 09f188c into develop May 21, 2026
2 checks passed
@luisremis
luisremis deleted the fix/issue-408 branch May 21, 2026 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Combined logger exception/warning

3 participants