@@ -68,11 +68,7 @@ class DownloadQuotaCommand(PairFormatterMixin, BaseCommand):
6868
6969 def execute (self , args : argparse .Namespace ) -> None :
7070 client = self ._create_client ()
71- try :
72- quota = client .download .quota ()
73- except Exception as e :
74- print (f"Error: { e } " , file = sys .stderr )
75- sys .exit (1 )
71+ quota = client .download .quota ()
7672 self .output (
7773 [("Remaining" , quota .quota ), ("Total" , quota .total )],
7874 args ,
@@ -92,11 +88,7 @@ def execute(self, args: argparse.Namespace) -> None:
9288 user_specified_page = args .page is not None
9389 page = args .page if args .page is not None else 1
9490 client = self ._create_client ()
95- try :
96- tasks , pagination = client .download .list (page )
97- except Exception as e :
98- print (f"Error: { e } " , file = sys .stderr )
99- sys .exit (1 )
91+ tasks , pagination = client .download .list (page )
10092 records = [_task_record (t ) for t in tasks ]
10193 self .output (records , args )
10294 if not user_specified_page and pagination .total > pagination .limit :
@@ -123,15 +115,11 @@ def execute(self, args: argparse.Namespace) -> None:
123115 client = self ._create_client ()
124116 urls = args .urls
125117 dest_dir = getattr (args , "dest" , None )
126- try :
127- if len (urls ) == 1 :
128- task = client .download .add_url (urls [0 ], dest_dir = dest_dir )
129- tasks = [task ]
130- else :
131- tasks = client .download .add_urls (* urls , dest_dir = dest_dir )
132- except Exception as e :
133- print (f"Error: { e } " , file = sys .stderr )
134- sys .exit (1 )
118+ if len (urls ) == 1 :
119+ task = client .download .add_url (urls [0 ], dest_dir = dest_dir )
120+ tasks = [task ]
121+ else :
122+ tasks = client .download .add_urls (* urls , dest_dir = dest_dir )
135123 records = [_task_record (t ) for t in tasks ]
136124 self .output (records , args )
137125
@@ -146,10 +134,6 @@ def register(self, parser: argparse.ArgumentParser) -> None:
146134
147135 def execute (self , args : argparse .Namespace ) -> None :
148136 client = self ._create_client ()
149- try :
150- client .download .delete (* args .hashes )
151- except Exception as e :
152- print (f"Error: { e } " , file = sys .stderr )
153- sys .exit (1 )
137+ client .download .delete (* args .hashes )
154138 for h in args .hashes :
155139 print (f"Deleted: { h } " )
0 commit comments