inveniosoftware / inveniosoftware/invenio-cli

Exception shoudn't be raised when no message catalogs

Open
#378 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
14
Forks
49
PR merge metrics
No merged PRs in 30d

Description

Package version (if known): v1.5.0

## Describe the bug
When running `invenio-cli services setup`, for an instance that doesn't use translations, the following exception is thrown and shows up on the terminal:

```
# ...
Created required fixtures!
Compiling message catalog...
Loading .env environment variables...
Traceback (most recent call last):
File "/home/me/my-project/.venv/bin/pybabel", line 8, in
sys.exit(main())
File "/home/me/my-project/.venv/lib/python3.9/site-packages/babel/messages/frontend.py", line 999, in main
return CommandLineInterface().run(sys.argv)
File "/home/me/my-project/.venv/lib/python3.9/site-packages/babel/messages/frontend.py", line 925, in run
return cmdinst.run()
File "/home/me/my-project/.venv/lib/python3.9/site-packages/babel/messages/frontend.py", line 199, in run
for errors in self._run_domain(domain).values():
File "/home/me/my-project/.venv/lib/python3.9/site-packages/babel/messages/frontend.py", line 237, in _run_domain
raise OptionError('no message catalogs found')
babel.messages.frontend.OptionError: no message catalogs found

Declaring queues...
# ...
```

This doesn't prevent the rest of the steps to go ahead, but is alarming to the lay-developer. Absence of translations should not be a concern.

## Expected behavior
Multiple avenues are possible. Either:

- like custom fields, print out `No message catalogs found. Exiting...` in green
- like custom fields but in orange and using "skipping": "No message catalogs found. Skipping."
- not even attempting to compile message catalogs in the first place
- not printing anything following "Compiling message catalog..."

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.