Skip to content

Commit

Permalink
Merge pull request #52 from GetStream/fix-error-messages
Browse files Browse the repository at this point in the history
Fix error message code for errors with exception_fields
  • Loading branch information
JelteF committed Dec 15, 2016
2 parents a48f6aa + 33a6c8c commit 0abc857
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG
Expand Up @@ -2,6 +2,15 @@
Change history
================

Unreleased
==========
:release-date: YYYY-MM-DD
:by: Unknown

* Fix errors_from_fields function so it displays the extra data returned by the
server about InputException errors.


2.3.8
=====
:release-date: 2016-06-09
Expand Down
4 changes: 2 additions & 2 deletions stream/client.py
Expand Up @@ -180,11 +180,11 @@ def raise_exception(self, result, status_code):

def errors_from_fields(exception_fields):
result = []
if not isinstance(exception_fields, list):
if not isinstance(exception_fields, dict):
return exception_fields

for field, errors in exception_fields.items():
errors.append('Field "%s" errors: %s' % (field, repr(errors)))
result.append('Field "%s" errors: %s' % (field, repr(errors)))
return result

if result is not None:
Expand Down

0 comments on commit 0abc857

Please sign in to comment.