[spyne] The helpfulness of logs, validation error contains no reference to the key

Burak Arslan burak.arslan at arskom.com.tr
Thu Jun 19 11:58:32 UTC 2014


Hi Alex,

Now that things are a bit clearer, do you think validation messages
still need improvement?

I try to put as little information in there as possible as everything is
there in the WSDL document.

Best regards,
Burak


On 06/10/14 16:47, Alex wrote:
> Hi,
>
> I ran another test with the fresh version of the code, the output is
> now different, but not yet helpful. Here is a log excerpt:
>
> DEBUG:spyne.protocol.dictdoc:   header : None
> DEBUG:spyne.protocol.dictdoc:   body   :
> {u'GetRequestNewTypeCreationList': {u'data': {u'status': u'new',
> u'operatorId ': u'7e3cb207-eda9-4fcc-85cb-51b0241ff10f'}}}
> ERROR:spyne.server._base:Fault(Client.ValidationError: 'The value "(0,
> u\'n\')" could not be validated.')
> Traceback (most recent call last):
>   File "/home/alex/neto/venv/local/lib/python2.7/site-packages/spyne/server/_base.py",
> line 88, in get_in_object
>     message=self.app.in_protocol.REQUEST)
>   File "/home/alex/neto/venv/local/lib/python2.7/site-packages/spyne/protocol/dictdoc.py",
> line 572, in deserialize
>     self.validator)
>   File "/home/alex/neto/venv/local/lib/python2.7/site-packages/spyne/protocol/dictdoc.py",
> line 698, in _doc_to_object
>     value = self._from_dict_value(k, member, v, validator)
>   File "/home/alex/neto/venv/local/lib/python2.7/site-packages/spyne/protocol/dictdoc.py",
> line 629, in _from_dict_value
>     retval = self._doc_to_object(class_, value, validator)
>   File "/home/alex/neto/venv/local/lib/python2.7/site-packages/spyne/protocol/dictdoc.py",
> line 698, in _doc_to_object
>     value = self._from_dict_value(k, member, v, validator)
>   File "/home/alex/neto/venv/local/lib/python2.7/site-packages/spyne/protocol/dictdoc.py",
> line 629, in _from_dict_value
>     retval = self._doc_to_object(class_, value, validator)
>   File "/home/alex/neto/venv/local/lib/python2.7/site-packages/spyne/protocol/dictdoc.py",
> line 663, in _doc_to_object
>     validator))
>   File "/home/alex/neto/venv/local/lib/python2.7/site-packages/spyne/protocol/dictdoc.py",
> line 649, in _from_dict_value
>     raise ValidationError((key, retval))
> ValidationError: Fault(Client.ValidationError: 'The value "(0,
> u\'n\')" could not be validated.')
> ERROR:spyne.server.wsgi:Fault(Client.ValidationError: 'The value "(0,
> u\'n\')" could not be validated.')
> 192.168.1.13 - - [10/Jun/2014 16:41:39] "POST / HTTP/1.1" 400 105
>
>
> There is no key `0` nor there is a value equal to `u'n'` in the received input.
>
> If it said something like `the value u"new" for "status" could not be
> validated` - the problem would become clear (if that is indeed what is
> wrong).
>
>
>
> This specific type for `status` is defined as  `RequestStatus =
> Unicode(values=['new', 'processed'])`
>
>
> Alex



More information about the people mailing list