Suppress error output in HTTP exceptions #352
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix-check_internet_connection-function"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Modified exception handling in
httpFn.pyto suppress logging forTimeoutandHTTPErrorexceptions by settingemit=False. This ensures that these specific errors do not generate noisy output logs.requested review from @romangg
assigned to @fhdk
mentioned in issue #197
See issue #197
Will the error still be recorded somewhere? For my understanding are these errors being sent to stdout at the moment and not stderr?
To answer the question - a message will be printed later if the check is False
The returned boolen is used to determine how pacman-mirrors generate the mirrorlist.
If there is no network the mirrorlist is randomized from the available pool - whether this is custom or default.
See the main run() function in pacman_mirrors/pacman_mirrors.py
I am looking at moving the network check below cliFn.parse_command_line()
Something like
I think the printing of the missing connection error is something added by Vitor in the process of counting installations.
Ok, but I'm talking specifically about the error happening on HTTP exceptions with your change. Will it be available still on stderr?
Because without your change I assume it's printed to stdout, right?
what I did was a quick fix - nothing is set in stone - the local function output_err() takes a bool emit defaulting to True - which if set to False will not print the error.
But still in the main run() we have
So the message to the user is still there - I don't know why there is the specific handling in check_internet_connection() to handle different exceptions - my guess is that it was something needed by Vitor's project - although I can see the value in returning a different value - but right now all errors make the function return False - which is not ideal.
added 1 commit
Compare with previous version
added 1 commit
Compare with previous version
I have refactored the check - using a broad exception as the last to catch the rest and print it.
I have reordered the function calls in the main run() so the network check occurs after parsing commandline - which will prevent the check if it is one of status arguments has been used
added 1 commit
Compare with previous version
added 1 commit
Compare with previous version
added 3 commits
masterCompare with previous version
I will rework this to make the commits clean
Pull request closed