Othernet-Project / librarian-core

GNU General Public License v3.0
1 stars 0 forks source link

Config missing error is normal, don't scream about it #7

Open foxbunny opened 8 years ago

foxbunny commented 8 years ago

Normally, we se a traceback.

Traceback (most recent call last):
  File "/home/hajime/.envs/libtest/bin/librarian", line 9, in <module>
    load_entry_point('librarian==0.5.dev1', 'console_scripts', 'librarian')()
  File "/home/hajime/code/librarian/librarian/app.py", line 29, in main
    supervisor = Supervisor(root_dir)
  File "/home/hajime/code/librarian-core/librarian_core/supervisor.py", line 67, in __init__
    self._configure(root_dir)
  File "/home/hajime/code/librarian-core/librarian_core/supervisor.py", line 102, in _configure
    self.config = self.app.config = self._load_config(self.config_path)
  File "/home/hajime/code/librarian-core/librarian_core/supervisor.py", line 92, in _load_config
    autojson=True)
  File "/home/hajime/code/librarian-core/librarian_core/confloader.py", line 95, in from_file
    "Missing or empty configuration file at '{}'".format(path))
librarian_core.confloader.ConfigurationError: Missing or empty configuration file at '/home/hajime/code/libtest/config.missing'

This should result in just the error message Missing or empty configuration file at '/home/hajime/code/libtest/config.missing' and nothing more.

dbinoj commented 8 years ago

I was looking at librarian-core's code today and stumbled upon this issue. Do you want a file called "config.missing" at the root of the project created when it fails to read a config file?

foxbunny commented 8 years ago

Definitely not. Did you spot code that creates one?

dbinoj commented 8 years ago

well, I searched and no i didnt find any reference for any config.missing. I was just confused at your issue description:

"This should result in just the error message Missing or empty configuration file at '/home/hajime/code/libtest/config.missing' and nothing more."

foxbunny commented 8 years ago

Yeah, that is weird, though it was definitely result of using wrong config parameter. Looks like that bit needs thorough review. Thanks for spotting that.