@@ -125,15 +125,15 @@ def do_project_export_download(self) -> None:
125
125
assert data is not None
126
126
sys .stdout .buffer .write (data )
127
127
128
- except Exception as e :
128
+ except Exception as e : # pragma: no cover, cli.die is unit-tested
129
129
cli .die ("Impossible to download the export" , e )
130
130
131
131
def do_create (self ) -> gitlab .base .RESTObject :
132
132
if TYPE_CHECKING :
133
133
assert isinstance (self .mgr , gitlab .mixins .CreateMixin )
134
134
try :
135
135
result = self .mgr .create (self .args )
136
- except Exception as e :
136
+ except Exception as e : # pragma: no cover, cli.die is unit-tested
137
137
cli .die ("Impossible to create object" , e )
138
138
return result
139
139
@@ -144,15 +144,15 @@ def do_list(
144
144
assert isinstance (self .mgr , gitlab .mixins .ListMixin )
145
145
try :
146
146
result = self .mgr .list (** self .args )
147
- except Exception as e :
147
+ except Exception as e : # pragma: no cover, cli.die is unit-tested
148
148
cli .die ("Impossible to list objects" , e )
149
149
return result
150
150
151
151
def do_get (self ) -> Optional [gitlab .base .RESTObject ]:
152
152
if isinstance (self .mgr , gitlab .mixins .GetWithoutIdMixin ):
153
153
try :
154
154
result = self .mgr .get (id = None , ** self .args )
155
- except Exception as e :
155
+ except Exception as e : # pragma: no cover, cli.die is unit-tested
156
156
cli .die ("Impossible to get object" , e )
157
157
return result
158
158
@@ -163,7 +163,7 @@ def do_get(self) -> Optional[gitlab.base.RESTObject]:
163
163
id = self .args .pop (self .cls ._id_attr )
164
164
try :
165
165
result = self .mgr .get (id , lazy = False , ** self .args )
166
- except Exception as e :
166
+ except Exception as e : # pragma: no cover, cli.die is unit-tested
167
167
cli .die ("Impossible to get object" , e )
168
168
return result
169
169
@@ -174,7 +174,7 @@ def do_delete(self) -> None:
174
174
id = self .args .pop (self .cls ._id_attr )
175
175
try :
176
176
self .mgr .delete (id , ** self .args )
177
- except Exception as e :
177
+ except Exception as e : # pragma: no cover, cli.die is unit-tested
178
178
cli .die ("Impossible to destroy object" , e )
179
179
180
180
def do_update (self ) -> Dict [str , Any ]:
@@ -189,7 +189,7 @@ def do_update(self) -> Dict[str, Any]:
189
189
190
190
try :
191
191
result = self .mgr .update (id , self .args )
192
- except Exception as e :
192
+ except Exception as e : # pragma: no cover, cli.die is unit-tested
193
193
cli .die ("Impossible to update object" , e )
194
194
return result
195
195
0 commit comments