Strategy: Improve curl error message finding
The existing regex wasn't able to match errors like: curl: option --something: is unknown Additionally, the existing approach wouldn't capture multi-line errors, whereas this captures all the `curl:` lines from `stderr`.
This commit is contained in:
parent
f0dbd8d9a5
commit
6b66ec9e62
@ -247,10 +247,8 @@ module Homebrew
|
||||
return data
|
||||
end
|
||||
|
||||
/^(?<error_msg>curl: \(\d+\) .+)/ =~ stderr
|
||||
{
|
||||
messages: [error_msg.presence || "cURL failed without an error"],
|
||||
}
|
||||
error_msgs = stderr&.scan(/^curl:.+$/)
|
||||
{ messages: error_msgs.presence || ["cURL failed without a detectable error"] }
|
||||
end
|
||||
|
||||
# Handles the return value from a `strategy` block in a `livecheck`
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user