Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
Improve error handling for missing files #2551
Conversation
richvdh
assigned
erikjohnston
Oct 17, 2017
richvdh
referenced this pull request
Oct 17, 2017
Closed
Feedback on the repository-based installation of matrix-synapse on Debian 9/Stretch (Spoiler: It sucks.) #2455
|
I'm a bit scared that we're losing some helpful hints for people tying to use python directly, or do we have error messages elsewhere if a config file isn't specified? Generally we can rewrite the help text in the debian build where appropriate (e.g. we already remove references to |
| def check_file(cls, file_path, config_name): | ||
| if file_path is None: | ||
| raise ConfigError( | ||
| "Missing config for %s." | ||
| - " You must specify a path for the config file. You can " |
richvdh
Oct 17, 2017
Member
this text was completely bogus, afaict. This function is called to check that files referenced from the config file exist, rather than the config file itself.
if no config file is specified, you hit synapse/synapse/config/_base.py Line 319 in 9097f3f Of all the things caught by the messages I'm removing, I'm unconvinced that --generate-config will solve any of them rather than making everything worse. |
|
Ok, then that works for me |
richvdh commentedOct 17, 2017
•
edited
os.path.existsdoesn't allow us to distinguish between permissions errors andthe path actually not existing, which repeatedly confuses people. It also means
that we try to overwrite existing key files, which is super-confusing. (cf
issues #2455, #2379). Use os.stat instead.
Also, don't recomemnd the the use of --generate-config, which screws everything
up if you're using debian (cf #2455).