Skip to content

Commit 2c6a2d7

Browse files
committed
Replaced exception pass with log warning
1 parent a36c0e8 commit 2c6a2d7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

examples/all-in-one.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def get_cpu_temperature():
102102
cpu_temps = [get_cpu_temperature()] * 5
103103

104104
delay = 0.5 # Debounce the proximity tap
105-
mode = 0 # The starting mode
105+
mode = 0 # The starting mode
106106
last_page = 0
107107
light = 1
108108

@@ -194,7 +194,7 @@ def get_cpu_temperature():
194194
try:
195195
data = pms5003.read()
196196
except pmsReadTimeoutError:
197-
pass
197+
logging.warn("Failed to read PMS5003")
198198
else:
199199
data = data.pm_ug_per_m3(1.0)
200200
display_text(variables[mode], data, unit)
@@ -205,7 +205,7 @@ def get_cpu_temperature():
205205
try:
206206
data = pms5003.read()
207207
except pmsReadTimeoutError:
208-
pass
208+
logging.warn("Failed to read PMS5003")
209209
else:
210210
data = data.pm_ug_per_m3(2.5)
211211
display_text(variables[mode], data, unit)
@@ -216,7 +216,7 @@ def get_cpu_temperature():
216216
try:
217217
data = pms5003.read()
218218
except pmsReadTimeoutError:
219-
pass
219+
logging.warn("Failed to read PMS5003")
220220
else:
221221
data = data.pm_ug_per_m3(10)
222222
display_text(variables[mode], data, unit)

0 commit comments

Comments
 (0)