Skip to content

Improve error handling: surface swallowed errors#3

Merged
undivisible merged 4 commits into
masterfrom
devin/1782092847-improve-error-handling
Jun 22, 2026
Merged

Improve error handling: surface swallowed errors#3
undivisible merged 4 commits into
masterfrom
devin/1782092847-improve-error-handling

Conversation

@devin-ai-integration

Copy link
Copy Markdown
Contributor

Summary

Several production code paths silently discard errors via let _ = or Err(_) =>, making failures invisible when debugging. This PR surfaces those errors through stderr warnings or structured report fields.

Key changes:

  • compile_cache::write_cached_report result was discarded — now logs [cache] warning: … on failure
  • Component metadata writes (owned_compile::write_component_metadata, boot image sidecar in main) — Err(_) => None / let _ = fs::write(…) replaced with eprintln! warnings
  • Import resolution failure in compile_owned — was eprintln! only, now also populates report.reason_code = "import-resolution-failed" + report.reason/report.error so callers see the failure in the structured report
  • Compiler CLI (compiler/rust-driver/crates/cli) — File::create(&md_path).unwrap() replaced with proper match to avoid panics on file creation errors
  • backend_capabilities (both in-cli and rust-driver) — Err(_) from select_backend now logs [backend] unsupported target …: {e} before falling back
  • language_gates — parse errors now logged with [gate] parse failed for …: {e}
  • package_manifest::source_identity_for_pathErr(_) branches now include the underlying error in the reason field (e.g. "source-read-failed: No such file …")
  • package_externfs::read_to_string(…).unwrap_or_default() replaced with explicit match + warning
  • cmd_eval temp dir creation — let _ = create_dir_all(…) replaced with ? propagation

Link to Devin session: https://app.devin.ai/sessions/926917492b93439180c3bc7bbd6c4c17
Requested by: @undivisible

- owned_compile: log cache write failures and metadata write failures
  instead of silently discarding them; populate report fields on
  import resolution failure so callers can see the reason
- main (boot image metadata): warn on sidecar write failure instead
  of silently dropping it
- main (cmd_eval): propagate temp-dir creation error instead of
  ignoring it
- compiler CLI: replace File::create().unwrap() with proper match so
  metadata file creation errors are reported rather than panicking
- backend capabilities (in-cli + rust-driver): log unsupported target
  errors instead of silently falling back to RawBinary
- language_gates: log parse errors when a gate check fails so the
  reason is visible in terminal output
- package_manifest: include the underlying error in source-read-failed
  and surface-parse-failed reason strings
- package_extern: warn when source file cannot be read instead of
  silently substituting an empty string

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@undivisible undivisible self-assigned this Jun 22, 2026
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

undivisible and others added 3 commits June 22, 2026 01:54
Fixes pre-existing formatting drift plus formatting for the new
error-handling code.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Replace or_else with or for constant match arms
(unnecessary_lazy_evaluations) and collapse nested if
(collapsible_if).

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@undivisible undivisible merged commit 4c2c156 into master Jun 22, 2026
9 of 12 checks passed
@undivisible undivisible deleted the devin/1782092847-improve-error-handling branch June 22, 2026 14:38
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

Devin is archived and cannot be woken up. Please unarchive Devin if you want to continue using it.

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