Skip to content

Commit 305a79f

Browse files
Fix for Empty except
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
1 parent 1a3aa67 commit 305a79f

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

‎python_package/examples/spotify_dataset_collection/spotify_data_collection.py‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,11 @@ def run(self):
5050
counter_for_duration = counter_for_duration + 1
5151
is_end = False
5252
is_playing = True
53-
except BaseException:
54-
pass
53+
except (AttributeError, TypeError) as e:
54+
BoardShim.log_message(
55+
LogLevels.LEVEL_WARN.value,
56+
'Failed to read current track info, skipping this poll iteration: %s' % str(e)
57+
)
5558
elif not track.get('is_playing', True):
5659
is_end = True
5760
except AttributeError as e:

0 commit comments

Comments
 (0)