Skip to content

Commit

Permalink
Merge pull request #850 from vmiller/fix-822
Browse files Browse the repository at this point in the history
Add back error handing to address issue 822
  • Loading branch information
nmcspadden committed Jun 20, 2023
2 parents 7c253d6 + 5d3418c commit d7cf620
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Code/autopkglib/URLGetter.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,13 +168,15 @@ def parse_headers(self, raw_headers):

def execute_curl(self, curl_cmd, text=True):
"""Execute curl command. Return stdout, stderr and return code."""
errors = "ignore" if text else None
try:
result = subprocess.run(
curl_cmd,
shell=False,
capture_output=True,
check=True,
text=text,
errors=errors,
)
except subprocess.CalledProcessError as e:
self.output(f"ERROR: {e.stderr.removeprefix('curl: ')}")
Expand Down

0 comments on commit d7cf620

Please sign in to comment.