File tree 1 file changed +8
-1
lines changed 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 6
6
import os
7
7
import sys
8
8
import typing
9
+ import urllib .error
9
10
from collections .abc import Mapping , Sequence
10
11
from pathlib import Path
11
12
from typing import Any , Literal
17
18
else :
18
19
import rich_click as click
19
20
21
+ import rich
20
22
import rich .console
21
23
import rich .markdown
22
24
import rich .syntax
@@ -265,7 +267,12 @@ def _remote_path_processor(package: Path) -> Path | GHPath:
265
267
msg = "online repo must be of the form 'gh:org/repo@branch[:path]' (:branch missing)"
266
268
raise click .BadParameter (msg )
267
269
org_repo , branch = org_repo_branch .split ("@" , maxsplit = 1 )
268
- return GHPath (repo = org_repo , branch = branch , path = p [0 ] if p else "" )
270
+ try :
271
+ return GHPath (repo = org_repo , branch = branch , path = p [0 ] if p else "" )
272
+ except urllib .error .HTTPError as e :
273
+ rich .print (f"[red][bold]Error[/bold] accessing { e .url } " , file = sys .stderr )
274
+ rich .print (f"[red]{ e } " , file = sys .stderr )
275
+ raise SystemExit (1 ) from None
269
276
270
277
271
278
@click .command (context_settings = {"help_option_names" : ["-h" , "--help" ]})
You can’t perform that action at this time.
0 commit comments