File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed
Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change 99from typing import Any , List , Optional
1010
1111from pydantic import BaseModel
12+ import requests
1213from yaml import safe_load
1314
1415from .base import APIClient
@@ -236,10 +237,20 @@ def download(self, path: Path) -> list[Path]:
236237 return []
237238 path .parent .mkdir (parents = True , exist_ok = True )
238239 log .info ("Downloading logs for %s to %s" , self .id , path )
239- self .client .download (
240- f"/v1.1/project/github/{ self .repo } /{ self .job } /output/{ self .step } /{ self .index } ?file=true" ,
241- path ,
242- )
240+ try :
241+ self .client .download (
242+ f"/v1.1/project/github/{ self .repo } /{ self .job } /output/{ self .step } /{ self .index } ?file=true" ,
243+ path ,
244+ )
245+ except requests .HTTPError as e :
246+ if e .response is not None and e .response .status_code == 404 :
247+ # 404 can happen when a job was cancelled before it began.
248+ log .error (
249+ "Request for logs returned %d; skipping" , e .response .status_code
250+ )
251+ return []
252+ else :
253+ raise
243254 return [path ]
244255
245256
You can’t perform that action at this time.
0 commit comments