Strategy: Improve curl error message finding #11973
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
brew style
with your changes locally?brew typecheck
with your changes locally?brew tests
with your changes locally?When I originally migrated livecheck to
curl
, the errors we were encountering typically started withcurl:
and a number in parentheses before the error message (e.g.,curl: (60) SSL certificate problem: certificate has expired
). However,curl
produces some errors that don't adhere to this format.In some cases, the error message doesn't include a leading number in parentheses. Additionally, some errors can include multiple messages. For example:
With this in mind, it's necessary to loosen the regex that's used to identify curl error messages and to use
#scan
to collect all of the error message lines instderr
. Otherwise we incorrectly miss certain error messages and get the fallbackcURL failed without an error
message, which we shouldn't see.For what it's worth, I encountered this shortcoming as part of implementing support for specifying
curl
args in alivecheck
block. I'll be creating a PR for that work soon but I wanted to extract this commit from that branch beforehand, to simplify the forthcoming PR.