[chirp_devel] [PATCH] radioreference: catch errors like invalid auth. #1359

Tom Hayward
Wed Jan 8 15:37:46 PST 2014


# HG changeset patch
# User Tom Hayward <tom at tomh.us>
# Date 1389224113 28800
# Node ID b6be379de4716f69314761c27aabe38c01df039a
# Parent  e1eb3f50c25b791a9e4bdfc0b79372665814cb6c
radioreference: catch errors like invalid auth. #1359

diff -r e1eb3f50c25b -r b6be379de471 chirp/radioreference.py
--- a/chirp/radioreference.py	Sat Jan 04 09:31:03 2014 -0800
+++ b/chirp/radioreference.py	Wed Jan 08 15:35:13 2014 -0800
@@ -16,6 +16,7 @@
 from chirp import chirp_common, errors
 try:
     from suds.client import Client
+    from suds import WebFault
     HAVE_SUDS = True
 except ImportError:
     HAVE_SUDS = False
@@ -62,8 +63,11 @@
         """Fetches frequencies for all subcategories in a county."""
         self._freqs = []
 
-        zipcode = self._client.service.getZipcodeInfo(self._zip, self._auth)
-        county = self._client.service.getCountyInfo(zipcode.ctid, self._auth)
+        try:
+            zipcode = self._client.service.getZipcodeInfo(self._zip, self._auth)
+            county = self._client.service.getCountyInfo(zipcode.ctid, self._auth)
+        except WebFault, err:
+            raise errors.RadioError(err)
 
         status = chirp_common.Status()
         status.max = 0



More information about the chirp_devel mailing list