benoitc / couchdbkit

CouchDB python framework
http://couchdbkit.org
Other
265 stars 94 forks source link

improve the error message for unknown doc type from view #168

Closed dannyroberts closed 11 years ago

dannyroberts commented 11 years ago

The traceback now looks something like this

  ...
    User.view('users/all', include_docs=True)
  File "/Users/droberts/dimagi/commcare-hq/couchdbkit/client.py", line 947, in iterator
    yield wrapper(row)
  File "/Users/droberts/dimagi/commcare-hq/couchdbkit/client.py", line 919, in row_wrapper
    return schema(doc)
  File "/Users/droberts/dimagi/commcare-hq/couchdbkit/schema/util.py", line 37, in wrap
    "This behavior is new starting in 0.6.2.".format(doc_type)
DocTypeError: the document being wrapped has doc type 'WebUser'. To wrap it anyway, you must explicitly pass in classes={'WebUser': <document class>} to your view. This behavior is new starting in 0.6.2.

see comment on the now-closed PR https://github.com/benoitc/couchdbkit/pull/167#issuecomment-23582071

benoitc commented 11 years ago

well done. merging it, thanks!

dannyroberts commented 11 years ago

Thanks!