Skip to content

Commit

Permalink
Add connection error exception handling (#569)
Browse files Browse the repository at this point in the history
* add connection error exception

* add self.log.warn() message
  • Loading branch information
sanahabhimani authored Nov 14, 2023
1 parent 5960617 commit 7dcb02f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions socs/agents/ucsc_radiometer/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ def acq(self, session, params=None):
except ValueError:
pm.sleep()
continue
except requests.exceptions.ConnectionError:
self.log.warn("Unable to connect to radiometer server. Connection closed. Trying again..")
pm.sleep()
continue
data = r.json()
last_pwv = data['pwv']
last_timestamp = data['timestamp']
Expand Down

0 comments on commit 7dcb02f

Please sign in to comment.