Skip to content

fix(compute): clarify fastly.toml error message when file not found - #1556

Merged
anthony-gomez-fastly merged 2 commits into
fastly:mainfrom
backkem:explicit-manifest-error
Oct 20, 2025
Merged

anthony-gomez-fastly merged 2 commits into
fastly:mainfrom
backkem:explicit-manifest-error

Conversation

@backkem

@backkem backkem commented Oct 20, 2025

Copy link
Copy Markdown
Contributor

Add "file not found" to the ErrReadingManifest error message to make it clearer that the file doesn't exist, rather than a parsing or permission error.

Change summary

The current error message "error reading fastly.toml" is somewhat ambiguous and doesn't clearly indicate whether the file is missing or has parsing errors. The remediation text was present but it still seems easy to misinterpret the actual problem (as proven by it managing to throw both me, Claude and ChatGPT off 😅).

This change adds ": file not found" to the error message to make it even more apparent that the file doesn't exist.

Before:
ERROR: error reading fastly.toml. Ensure the Fastly CLI is being run within a directory containing a fastly.toml
file...

After:
ERROR: error reading fastly.toml: file not found. Ensure the Fastly CLI is being run within a directory containing
a fastly.toml file...

All Submissions:

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for
    the same update/change?

Changes to Core Features:

  • Have you written new tests for your core changes, as applicable?
  • Have you successfully run tests with your changes locally?

User Impact

  • Users will now more easily understand that the fastly.toml file is missing.

@backkem
backkem requested a review from a team as a code owner October 20, 2025 09:39
@backkem
backkem requested a review from rcaril October 20, 2025 09:39
Add "file not found" to the ErrReadingManifest error message to make it
clearer that the file doesn't exist, rather than a parsing or permission error.
@backkem
backkem force-pushed the explicit-manifest-error branch from 145b929 to 41a9ff2 Compare October 20, 2025 09:41
@anthony-gomez-fastly
anthony-gomez-fastly enabled auto-merge (squash) October 20, 2025 16:25
@anthony-gomez-fastly
anthony-gomez-fastly merged commit c7b8baf into fastly:main Oct 20, 2025
@backkem
backkem deleted the explicit-manifest-error branch October 20, 2025 17:50
WhiteAbeLincoln added a commit that referenced this pull request Sep 25, 2026
When a fastly.toml file is present but missing a `name` field, the
`fastly compute deploy` command would return a confusing "file not found"
error. This was due to the use of the `ErrReadingManifest` error, which
was previously used for all sorts of manifest errors, but the wording
was changed PR #1556 to be specific to not found errors.

The fix is to return a `ErrMissingManifestName` in these situations, and
we additionally ensure that the `--package` flag remediation is returned
wherever it is relevant.
WhiteAbeLincoln added a commit that referenced this pull request Sep 25, 2026
When a fastly.toml file is present but missing a `name` field, the
`fastly compute deploy` command would return a confusing "file not found"
error. This was due to the use of the `ErrReadingManifest` error, which
was previously used for all sorts of manifest errors, but the wording
was changed PR #1556 to be specific to not found errors.

The fix is to return a `ErrMissingManifestName` in these situations, and
we additionally ensure that the `--package` flag remediation is returned
wherever it is relevant.
WhiteAbeLincoln added a commit that referenced this pull request Sep 28, 2026
### Change summary

When a fastly.toml file is present but missing a `name` field, the
`fastly compute deploy` command would return a confusing "file not
found" error. This was due to the use of the `ErrReadingManifest` error,
which was previously used for all sorts of manifest errors, but was
changed but the wording
was changed PR #1556 to be specific to not found errors

The fix is to return a `ErrMissingManifestName` in these situations, and
we additionally ensure that the `--package` flag remediation is returned
wherever it is relevant.

All Submissions:

* [X] Have you followed the guidelines in our Contributing document?
* [X] Have you checked to ensure there aren't other open [Pull
Requests](https://github.com/fastly/cli/pulls) for the same
update/change?

### Changes to Core Features:

* [X] Have you written new tests for your core changes, as applicable?
* [X] Have you successfully run tests with your changes locally?

### User Impact

Fixes confusing error, which admittedly only occurs in rare cases.

### Are there any considerations that need to be addressed for release?

<!-- Any breaking changes, etc -->
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.

3 participants