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

Give more meaningful error messages when functions are not supported #88

Open
sillly-milly opened this issue Apr 4, 2023 · 0 comments

Comments

@sillly-milly
Copy link

While I was looking at #87, and elasticmock's lack of support for the Elasticsearch.update function, I found that this lack of support is a bit non-obvious: the mocker doesn't implement the function, so it falls through to the super class which does the real thing, which tries to contact the server but if there is no server then it fails with ConnectionRefused. It's a little obscure to interpret this as a "not supported" error, but I wonder if there could also be worse implications for someone who does have an important running server on their local machine and accidentally starts modifying real data on that server during their tests when they believe that they are safely mocking? Either way, I wonder if it's in our power to give a more meaningful error message in these cases e.g. override all the super methods to catch a ConnectionRefused and turn it into a NotImplementedError?

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