Skip to content

Commit

Permalink
Writing URLErrors to log file to debug macOS binary
Browse files Browse the repository at this point in the history
  • Loading branch information
Greg Blumberg committed Sep 20, 2019
1 parent bf67c52 commit 0cb4922
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 4 additions & 2 deletions datasources/data_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,8 @@ def getAvailableAtTime(self, **kwargs):

self._is_available = True

except URLError:
except URLError as err:
logger.exception(err)
stns_avail = []
self._is_available = False
logging.debug("_is_available: "+ str(self._is_available))
Expand All @@ -279,7 +280,8 @@ def getAvailableTimes(self, max_cycles=100, **kwargs):
if len(times) == 1:
times = self.getArchivedCycles(start=times[0], max_cycles=max_cycles)
self._is_available = True
except URLError:
except URLError as err:
logger.exception(err)
custom_failed = True
self._is_available = False

Expand Down
4 changes: 3 additions & 1 deletion runsharp/full_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
import platform

HOME_DIR = os.path.join(os.path.expanduser("~"), ".sharppy")
os.mkdir(HOME_DIR)
if not os.path.isdir(HOME_DIR):
os.mkdir(HOME_DIR)

HEADER = '\033[95m'
OKBLUE = '\033[94m'
Expand Down Expand Up @@ -80,6 +81,7 @@
ver = get_versions()
del get_versions

print(datasources.__file__)
logging.info('Started logging output for SHARPpy')
logging.info('SHARPpy version: ' + str(__version__))
logging.info('numpy version: ' + str(np.__version__))
Expand Down

0 comments on commit 0cb4922

Please sign in to comment.