Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1from marshmallow import Schema, ValidationError 

2 

3 

4class DTOSchema(Schema): 

5 def handle_error(self, exc, data, **kwargs): 

6 """raise our custom exception when (de)serialization fails.""" 

7 errors = [] 

8 for k, m in exc.messages.items(): 

9 errors += [*m] 

10 raise ValidationError(message=errors)