Skip to content

Commit

Permalink
Catch URLError
Browse files Browse the repository at this point in the history
Should not self-destrict if SSL cert is wrong etc.
  • Loading branch information
sphen13 committed Oct 10, 2018
1 parent c91ddca commit 49fd984
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
include /usr/local/share/luggage/luggage.make
TITLE=B2Middleware
REVERSE_DOMAIN=com.github.sphen13.b2middleware
PACKAGE_VERSION=1.1
PACKAGE_VERSION=1.2
PAYLOAD=pack-middleware\
pack-script-postinstall

Expand Down
6 changes: 5 additions & 1 deletion middleware_b2.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from Foundation import kCFPreferencesAnyUser
from Foundation import kCFPreferencesCurrentHost

__version__ = '1.1'
__version__ = '1.2'

BUNDLE = 'ManagedInstalls'

Expand Down Expand Up @@ -65,6 +65,10 @@ def authorize_b2(account_id, application_key):
# we got an error - return None
print ('B2-Middleware: HTTPError ' + str(e.code))
return None, None, None, None
except urllib2.URLError, e:
# we got an error - return None
print ('B2-Middleware: URLError ' + str(e))
return None, None, None, None

response_data = json.loads(response.read())
response.close()
Expand Down

0 comments on commit 49fd984

Please sign in to comment.