@@ -202,13 +202,13 @@ def get_ext_metadata(self, extension_kind: ExtensionKind, uri: str):
202202
203203 body = response .content
204204 if body is None :
205- raise ConnectionError ("Extended Metadata request failed: No response body" )
205+ raise ConnectionError ("Extended Metadata request for {} failed: No response body" . format ( uri ) )
206206
207207 proto = BatchedExtensionResponse ()
208208 proto .ParseFromString (body )
209209 entityextd = proto .extended_metadata .pop ().extension_data .pop ()
210210 if entityextd .header .status_code != 200 :
211- raise ConnectionError ("Extended Metadata request failed: Status code {}" .format (entityextd .header .status_code ))
211+ raise ConnectionError ("Extended Metadata request for {} failed: Status code {}" .format (uri , entityextd .header .status_code ))
212212 mdb : bytes = entityextd .extension_data .value
213213 return mdb
214214
@@ -267,20 +267,20 @@ def get_metadata_4_show(self, show: ShowId) -> Metadata.Show:
267267 md .ParseFromString (mdb )
268268 return md
269269
270- def get_playlist (self ,
271- _id : PlaylistId ) -> Playlist4External .SelectedListContent :
270+ def get_playlist (self , playlist : PlaylistId ) -> Playlist4External .SelectedListContent :
272271 """
273272
274- :param _id : PlaylistId:
273+ :param playlist : PlaylistId:
275274
276275 """
277- response = self .send ("GET" ,
278- "/playlist/v2/playlist/{}" .format (_id .id ()), None ,
279- None )
276+ response = self .send ("GET" , "/playlist/v2/playlist/{}" .format (playlist .id ()),
277+ None , None )
280278 ApiClient .StatusCodeException .check_status (response )
279+
281280 body = response .content
282281 if body is None :
283- raise IOError ()
282+ raise ConnectionError ("Playlist Metadata request for {} failed: No response body" .format (playlist .to_spotify_uri ()))
283+
284284 proto = Playlist4External .SelectedListContent ()
285285 proto .ParseFromString (body )
286286 return proto
0 commit comments