Skip to content

Fix errors.json logging ENOENT: no such file or directory#2332

Merged
colinrotherham merged 2 commits intomainfrom
error-logging
Sep 18, 2023
Merged

Fix errors.json logging ENOENT: no such file or directory#2332
colinrotherham merged 2 commits intomainfrom
error-logging

Conversation

@colinrotherham
Copy link
Contributor

@colinrotherham colinrotherham commented Sep 13, 2023

This PR helped me find and fix an issue in #2306

Before that I was stuck with this error in the terminal:

Error: ENOENT: no such file or directory, open '/private/var/folders/2k/ws6lqbf57d75yf8xt7tt_bqc0000gn/T/test-prototype/.tmp/errors.json'

My issue had crashed early enough to confirm:

  1. The helper flagError() can run before .tmp directory exists
  2. Errors can be written as empty strings by writeJsonSync(errorPath, { error })

This PR stops that from happening

It was possible for `flagError()` to run before the .tmp directory had been created
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.

2 participants