Skip to content

refine preprocess error reporting#474

Merged
NGTmeaty merged 2 commits intointernetarchive:mainfrom
vbanos:preprocess-testable
Sep 11, 2025
Merged

refine preprocess error reporting#474
NGTmeaty merged 2 commits intointernetarchive:mainfrom
vbanos:preprocess-testable

Conversation

@vbanos
Copy link
Copy Markdown
Collaborator

@vbanos vbanos commented Sep 10, 2025

Stop using panic() inside the preprocess(), return the error in the main preprocessor().

This is relevant to #473

Stop using `panic()` inside the `preprocess()`, return the error in the
main `preprocessor()`.
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Sep 10, 2025

Codecov Report

❌ Patch coverage is 16.66667% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 56.41%. Comparing base (032cbd6) to head (03d3b7b).
⚠️ Report is 69 commits behind head on main.

Files with missing lines Patch % Lines
internal/pkg/preprocessor/preprocessor.go 16.66% 9 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #474      +/-   ##
==========================================
- Coverage   56.45%   56.41%   -0.05%     
==========================================
  Files         130      130              
  Lines        8052     8056       +4     
==========================================
- Hits         4546     4545       -1     
- Misses       3145     3149       +4     
- Partials      361      362       +1     
Flag Coverage Δ
e2etests 40.63% <16.66%> (-0.04%) ⬇️
unittests 29.46% <0.00%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

CorentinB
CorentinB previously approved these changes Sep 10, 2025
@CorentinB CorentinB added the enhancement New feature or request label Sep 10, 2025
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 refines error handling in the preprocessor by converting panic calls to proper error returns within the preprocess() function. The main change replaces several panic() calls with return err statements and adds error handling in the calling function.

  • Converts preprocess() from a void function to one that returns an error
  • Replaces internal panic() calls with proper error returns
  • Adds error handling in the worker() method that still panics but with better error messaging

Comment thread internal/pkg/preprocessor/preprocessor.go
Comment thread internal/pkg/preprocessor/preprocessor.go Outdated
Comment thread internal/pkg/preprocessor/preprocessor.go Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Collaborator

@NGTmeaty NGTmeaty left a comment

Choose a reason for hiding this comment

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

Looks good! Thank you!

@NGTmeaty NGTmeaty merged commit 4b733b5 into internetarchive:main Sep 11, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants