Skip to content

Improve error handling in check script - #1

Open
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1782479677-improve-error-handling
Open

Improve error handling in check script#1
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1782479677-improve-error-handling

Conversation

@devin-ai-integration

Copy link
Copy Markdown

Summary

The scripts/check.mjs file had a bare catch {} that silently swallowed all errors — permission denied, encoding failures, and actual missing files were all reported identically as "missing". This made debugging impossible when a file existed but couldn't be read.

Changes:

  • Catch block now inspects err.code to distinguish ENOENT (missing) from EACCES (permission denied) from other I/O errors, logging the actual err.message for non-trivial failures
  • Errors are written to stderr via console.error instead of stdout (success messages remain on stdout)
  • Empty files are detected and reported separately
  • JSON files (.json) are validated with JSON.parse; parse errors are surfaced with the specific parse failure message
  • A summary line reports total failure count before process.exit(1)

Link to Devin session: https://app.devin.ai/sessions/3d0fb42a2eba4bc0b3f67e75ff9b4334
Requested by: @cemphlvn

- Distinguish ENOENT from EACCES and other I/O errors instead of
  treating all failures as 'missing'
- Log errors to stderr with descriptive messages
- Validate JSON files parse correctly
- Detect empty files
- Report total failure count on exit

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

Copy link
Copy Markdown
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

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