Skip to content

Add guards against failures for missing input .mm files#18

Merged
jlblancoc merged 1 commit intodevelopfrom
fix/should-fail-on-missing-mm
Mar 3, 2026
Merged

Add guards against failures for missing input .mm files#18
jlblancoc merged 1 commit intodevelopfrom
fix/should-fail-on-missing-mm

Conversation

@jlblancoc
Copy link
Member

@jlblancoc jlblancoc commented Mar 3, 2026

Summary by CodeRabbit

  • Bug Fixes
    • Enhanced error handling in georeferencing command-line tools. The tools now validate that map files load successfully before processing any georeference data. If a map file is invalid or corrupted, the tools fail gracefully with a clear error message instead of silently continuing with potentially corrupted data, which prevents downstream issues.

@coderabbitai
Copy link

coderabbitai bot commented Mar 3, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between eb31c1e and 03d4bde.

📒 Files selected for processing (2)
  • mola_georeferencing/apps/mola-sm-georeferencing-cli.cpp
  • mola_georeferencing/apps/mola-trajectory-georef-cli.cpp

📝 Walkthrough

Walkthrough

Two CLI applications now validate .mm map file loading by checking the return value of mm.load_from_file(). If loading fails, a formatted exception is thrown, preventing subsequent operations on invalid maps. Previously, these failures were silently ignored.

Changes

Cohort / File(s) Summary
Map Loading Validation
mola_georeferencing/apps/mola-sm-georeferencing-cli.cpp, mola_georeferencing/apps/mola-trajectory-georef-cli.cpp
Added return value checks for mm.load_from_file() with formatted exception throwing on failure, replacing silent continuation with invalid map data.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A bunny checks before it hops,
No loading fails without a stop!
With validation guards in place,
Georeferencing finds its grace. ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding validation/guards when loading .mm files to handle failures for missing input files.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/should-fail-on-missing-mm

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@jlblancoc jlblancoc enabled auto-merge March 3, 2026 16:06
@jlblancoc jlblancoc disabled auto-merge March 3, 2026 16:06
@jlblancoc jlblancoc merged commit c679932 into develop Mar 3, 2026
3 of 7 checks passed
@jlblancoc jlblancoc deleted the fix/should-fail-on-missing-mm branch March 3, 2026 16:06
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