Skip to content

Form fix public error handling - #1108

Open
aolivier23 wants to merge 2 commits into
Framework-R-D:mainfrom
aolivier23:form_fix_public_error_handling
Open

aolivier23 wants to merge 2 commits into
Framework-R-D:mainfrom
aolivier23:form_fix_public_error_handling

Conversation

@aolivier23

@aolivier23 aolivier23 commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Removes form::experimental::error from public interface. FORM's registration code needs to throw an exception, and I accidentally replaced it with form::experimental::error. But form/util/error.hpp isn't exported by the project, and we probably don't want to export it. This mistake stops things like FORM parts of phlex-examples from compiling.

…pe_registry.hpp just throws a std::runtime_error like normal.
@coderabbitai

coderabbitai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The FORM source type registry now throws std::runtime_error when a conversion function is empty or product data is null. The header no longer includes util/error.hpp.

Changes: FORM registry error handling

Layer / File(s) Summary
Direct runtime errors
form/form/form_source_type_registry.hpp, form/form/form_source_type_registry.cpp
The registry now throws std::runtime_error for null product data and empty conversion functions. The header removes the util/error.hpp include.

Estimated code review effort: 2 (Simple) | ~5 minutes

Change: Refactor

Possibly related PRs

  • Framework-R-D/phlex#1080: Both PRs change the same registry error call sites, but PR #1080 standardizes error messages through a helper that this PR bypasses.

Suggested reviewers: wwuoneway, knoepfel, gemmeren

Merge Risk: Minimal · up to b9557

This is a small error-handling cleanup that keeps the same exception type and changes only the message text. No behavioral risk is identified. Run the formatter, using the @phlexbot format comment, to clear the failing format check before merging.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "Form fix public error handling" matches the changeset. The PR moves the public error path out of the registry. The registry now throws std::runtime_error instead of calling form::detail::ex…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Full details: Title check

Explanation

The title "Form fix public error handling" matches the changeset. The PR moves the public error path out of the registry. The registry now throws std::runtime_error instead of calling form::detail::experimental::error, and the util/error.hpp include is removed. The title is short and specific, though it uses the broad term "public error handling" and does not name the runtime_error change. That is a minor gap, not a mismatch.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
Fix failing CI checks

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@aolivier23

Copy link
Copy Markdown
Contributor Author

@phlexbot format

@github-actions

Copy link
Copy Markdown
Contributor

Format Fixes Applied

❌ clang-format workflow failure
❌ cmake-format workflow failure
❌ header-guards workflow failure
❌ jsonnetfmt workflow failure
❌ markdownlint workflow failure
❌ ruff workflow failure
❌ YAML formatter workflow failure

⚠️ Note: Some issues may require manual review.

@codecov

codecov Bot commented Nov 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

@@            Coverage Diff             @@
##             main    #1108      +/-   ##
==========================================
+ Coverage   91.45%   91.60%   +0.14%     
==========================================
  Files         185      185              
  Lines        6073     6072       -1     
  Branches      973      973              
==========================================
+ Hits         5554     5562       +8     
+ Misses        331      325       -6     
+ Partials      188      185       -3     
Flag Coverage Δ
amd64 91.60% <100.00%> (+0.14%) ⬆️
arm64 91.60% <100.00%> (+0.14%) ⬆️

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

Files with missing lines Coverage Δ
form/form/form_source_type_registry.cpp 100.00% <100.00%> (ø)
form/form/form_source_type_registry.hpp 100.00% <100.00%> (ø)

... and 2 files with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5a73c5c...b95572b. Read the comment docs.

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

This branch has not been deployed

No deployments
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.

1 participant