Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always throw error if config file is specified #502

Merged
merged 1 commit into from
Jul 6, 2022

Conversation

gamgi
Copy link
Contributor

@gamgi gamgi commented Jan 19, 2019

As mentioned in #498 current behaviour is to silently fail if --config file is not found. This can result in running the server with an unintended configuration without the user knowing about it.

The change in this PR ensures that errors are thrown if the --config file is explicitly specified.

Example behaviour:

$ serve -c nonexistent.json
ERROR: Not able to read /foo/nonexistent.json: ENOENT: no such file or directory, open '/foo/nonexistent.json'

@jakearchibald
Copy link

Ugh, yes please, merge this. This caught me out, especially as the config path is resolved against the content path, which is pretty unusual.

@longzheng
Copy link

longzheng commented Jun 8, 2021

I've also been caught out by this issue leading to a very confusing/frustrating situation, coupled with the fact that the config path is relative to the "served folder" and not the current working directory.

It is extremely subtle that the config was/was not being loaded.

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.

None yet

4 participants