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

save if a error occurs during sending of the request #22

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

fighterii
Copy link

This saves the error which occurs during sending in the Handler, so we have the ability to react on it (e.g. by disabling the logger if the server is not available).

@xente xente added the enhancement New feature or request label Nov 26, 2024
@xente xente requested a review from aibes1001 November 26, 2024 16:06
@xente xente self-assigned this Nov 26, 2024
@aibes1001
Copy link
Collaborator

aibes1001 commented Nov 27, 2024

Instead of returning the exception message in a variable maybe would be better to try to propagate the exception. It can give us the opportunity to customize the exception for this case and act accordingly.

@fighterii
Copy link
Author

@aibes1001 : So you mean to reraise the exception inside the loki_request.py and to catch the exception inside the _send method?

@aibes1001
Copy link
Collaborator

Yes, and then in _send() method we can handle the exception as we want (e.g. print the exception message, activate an error flag, etc.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants