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

improve error message when mfdata is not started #464

Open
matthieumarrast opened this issue Mar 14, 2023 · 0 comments
Open

improve error message when mfdata is not started #464

matthieumarrast opened this issue Mar 14, 2023 · 0 comments

Comments

@matthieumarrast
Copy link
Contributor

When mfdata is not started, an error stack trace ending with connecting to unix socket: /home/mfdata/var/redis.socket. No such file or directory is shown to the user :

  File "/opt/metwork-mfext-2.1/opt/python3/lib/python3.10/site-packages/redis/client.py", line 1235, in execute_command
    conn = self.connection or pool.get_connection(command_name, **options)
  File "/opt/metwork-mfext-2.1/opt/python3/lib/python3.10/site-packages/redis/connection.py", line 1387, in get_connection
    connection.connect()
  File "/opt/metwork-mfext-2.1/opt/python3/lib/python3.10/site-packages/redis/connection.py", line 617, in connect
    raise ConnectionError(self._error_message(e))
redis.exceptions.ConnectionError: Error 2 connecting to unix socket: /home/mfdata/var/redis.socket. No such file or directory.

It's not really readable for an user who maybe doesn't know that redis is used inside mfdata.

So it should be better to catch the error and to display an understandable message to the user, for example:
The redis socket is not found. You must start the mfdata module before using it.
or
It seems mfdata is not started. Start the module before use.

You can reproduce it by stopping mfdata and trying to inject a file using inject_file --incoming <file>

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

No branches or pull requests

1 participant