Skip to content

Conversation

@kiptoomm
Copy link

@kiptoomm kiptoomm commented Feb 6, 2018

  • Adds a block to catch validation exceptions that occur when PATCHing a resource

"""Immediately raises a :exc:`DeserializationException`."""
raise DeserializationException

class raise_s_validation_error(DefaultSerializer):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

expected 2 blank lines, found 1

- we want to force triggering of validation exceptions during
serialiation
- add unit test to verify that validation exception is raised on patch
- a validation exception should be raised when a validation error occurs
during serialization
- create a serializer class that automatically throws the validation
exception
- uses marshmallow's ValidationError exception, but in theory any
exception could be used to force the check in order to pass them
through to the flask-restless validations exceptions handler and
thus have it return meaningful errors to client

fix spacing issue caught by houndci
@kiptoomm kiptoomm force-pushed the debug_validate_patch branch from 287b085 to b3788d2 Compare February 6, 2018 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants