Skip to content

Commit def66e3

Browse files
committed
More detailed secrets error
1 parent 46921d0 commit def66e3

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

examples/requests_advanced.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@
99
# "password" keys with your WiFi credentials. DO NOT share that file or commit it into Git or other
1010
# source control.
1111
# pylint: disable=no-name-in-module,wrong-import-order
12-
from secrets import secrets
12+
try:
13+
from secrets import secrets
14+
except ImportError:
15+
print("WiFi secrets are kept in secrets.py, please add them there!")
16+
raise
1317

1418
# If you are using a board with pre-defined ESP32 Pins:
1519
esp32_cs = DigitalInOut(board.ESP_CS)

examples/requests_simpletest.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@
1010
# "password" keys with your WiFi credentials. DO NOT share that file or commit it into Git or other
1111
# source control.
1212
# pylint: disable=no-name-in-module,wrong-import-order
13-
from secrets import secrets
13+
try:
14+
from secrets import secrets
15+
except ImportError:
16+
print("WiFi secrets are kept in secrets.py, please add them there!")
17+
raise
1418

1519
# If you are using a board with pre-defined ESP32 Pins:
1620
esp32_cs = DigitalInOut(board.ESP_CS)

0 commit comments

Comments
 (0)