diff --git a/flask_micropub.py b/flask_micropub.py index 229db46..7011828 100644 --- a/flask_micropub.py +++ b/flask_micropub.py @@ -136,11 +136,13 @@ class MicropubClient: rdata = parse_qs(response.text) if response.status_code != 200: + error_vals = rdata.get('error') + error_descs = rdata.get('error_description') return AuthResponse( next_url=next_url, error='authorization failed. {}: {}'.format( - next(rdata.get('error', []), None), - next(rdata.get('error_description', []), None))) + error_vals[0] if error_vals else 'Unknown Error', + error_descs[0] if error_descs else 'Unknown Error')) if 'me' not in rdata: return AuthResponse( diff --git a/setup.py b/setup.py index c7f7565..105568a 100644 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ from setuptools import setup setup( name='Flask-Micropub', - version='0.1.2', + version='0.1.3', url='https://github.com/kylewm/flask-micropub/', license='BSD', author='Kyle Mahan',