Permalink
Browse files

Better and more consitent error handling in load_settings, plus clear…

…er debug.
  • Loading branch information...
1 parent d484554 commit 1a254d5a893ee4bc4c1757504213dff73de2be3d Nicholas Davidson committed Nov 14, 2012
Showing with 5 additions and 4 deletions.
  1. +5 −4 pybit/__init__.py
View
@@ -65,6 +65,7 @@ def get_build_route_name(dist, arch, suite, package):
def load_settings(path):
opened_file = None
opened_path = path
+ settings = {}
#try the unmodified path incase we're being passed an absolute path.
try:
opened_file = open(path)
@@ -81,11 +82,11 @@ def load_settings(path):
if opened_file:
encoded_string = opened_file.read()
try:
- return (jsonpickle.decode(encoded_string ), opened_path)
+ settings = jsonpickle.decode(encoded_string )
except ValueError :
- return ({}, opened_path)
- else:
- return ({}, opened_path)
+ print "Couldn't load any settings files."
+
+ return (settings, opened_path)
exchange_name="pybit"
status_route="pybit.control.status"

0 comments on commit 1a254d5

Please sign in to comment.