Skip to content

Commit 098ce0c

Browse files
committedJan 1, 2025··
Handle socket.gaierror in exception handling
1 parent e2ee3c6 commit 098ce0c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed
 

‎source/inverter_charge_controller.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import socket
12
from datetime import datetime, timedelta
23

34
import pause
@@ -67,7 +68,7 @@ def start(self) -> None:
6768
self._write_newlines_to_log_file()
6869
pause.until(next_price_minimum.timestamp)
6970

70-
except (ClientError, RequestException) as e:
71+
except (ClientError, RequestException, socket.gaierror) as e:
7172
self.log.exception(f"An exception occurred while trying to fetch data from a different system: {e}")
7273
self.log.warning(f"Waiting for {duration_to_wait_in_cause_of_error} to try again...")
7374
pause.seconds(duration_to_wait_in_cause_of_error.total_seconds())

0 commit comments

Comments
 (0)
Please sign in to comment.