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

feat(#1127): raise startup app error from es connection error #1145

Merged
merged 1 commit into from Feb 14, 2022

Conversation

frascuchon
Copy link
Member

By raising the error with from clause, you can separate errors details from the main error message. You will see an error like:

opensearchpy.exceptions.ConnectionTimeout: ConnectionTimeout caused by - ReadTimeoutError(HTTPConnectionPool(host='localhost', port=9200): Read timed out. (read timeout=10))

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/anaconda3/envs/rubrix/lib/python3.8/site-packages/starlette/routing.py", line 526, in lifespan
    async for item in self.lifespan_context(app):
  File "/usr/local/anaconda3/envs/rubrix/lib/python3.8/site-packages/starlette/routing.py", line 467, in default_lifespan
    await self.startup()
  File "/usr/local/anaconda3/envs/rubrix/lib/python3.8/site-packages/starlette/routing.py", line 502, in startup
    await handler()
  File "/usr/local/anaconda3/envs/rubrix/lib/python3.8/site-packages/rubrix/server/server.py", line 101, in configure_elasticsearch
    raise ConfigError(
pydantic.errors.ConfigError: Your Elasticsearch endpoint at http://localhost:9200 is not available or not responding.
Please make sure your Elasticsearch instance is launched and correctly running and
you have the necessary access permissions. Once you have verified this, restart the Rubrix server.

Closes #1127

@codecov
Copy link

codecov bot commented Feb 14, 2022

Codecov Report

Merging #1145 (60df22c) into master (304a9ad) will increase coverage by 0.17%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1145      +/-   ##
==========================================
+ Coverage   95.05%   95.22%   +0.17%     
==========================================
  Files         121      122       +1     
  Lines        4567     4798     +231     
==========================================
+ Hits         4341     4569     +228     
- Misses        226      229       +3     
Flag Coverage Δ
pytest 95.22% <ø> (+0.17%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/rubrix/server/server.py 80.85% <ø> (ø)
src/rubrix/client/sdk/datasets/models.py 100.00% <0.00%> (ø)
...rubrix/labeling/text_classification/weak_labels.py 100.00% <0.00%> (ø)
...ubrix/labeling/text_classification/label_errors.py 100.00% <0.00%> (ø)
src/rubrix/client/datasets.py 98.19% <0.00%> (ø)
src/rubrix/client/rubrix_client.py 92.77% <0.00%> (+0.24%) ⬆️
src/rubrix/__init__.py 85.41% <0.00%> (+0.31%) ⬆️
src/rubrix/client/models.py 100.00% <0.00%> (+1.08%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cfb5e7d...60df22c. Read the comment docs.

Copy link
Contributor

@dcfidalgo dcfidalgo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perfect 👌

@frascuchon frascuchon merged commit 8e4056b into master Feb 14, 2022
@frascuchon frascuchon deleted the feat/improve-es-unavailable-error-message branch February 14, 2022 13:24
frascuchon added a commit that referenced this pull request Feb 17, 2022
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

Successfully merging this pull request may close these issues.

[Server start] Improve message when elastic not launched/available
2 participants