------------------------------------------------------------------------------
To reply, visit https://hellosplat.com/s/beanbag/tickets/4723/
------------------------------------------------------------------------------

New update by jcannon
For Beanbag, Inc. > Djblets > Ticket #4723


Reply:

    That seems like it's probably a niche use-case. It might be better to just 
have your own exception handler:
    
    ```python
    class FieldException(Exception):
        ...
        
        
    class MyResource(WebAPIResource):
        @webapi_response_errors(INVALID_FORM_DATA):
        @webapi_request_fields(...)
        def create(self, data1, data2):
            try:
                data1 = self._helper(data1)
                data2 = self._helper(data2)
                return 201, {...}
            except FieldException as e:
                return INVALID_FORM_DATA, {...}
        
        def _helper(self, data):
            if 'my_key' not in data:
                raise FieldError(...)
    ```

-- 
You received this message because you are subscribed to the Google Groups 
"reviewboard-issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to reviewboard-issues+unsubscr...@googlegroups.com.
To post to this group, send email to reviewboard-issues@googlegroups.com.
Visit this group at https://groups.google.com/group/reviewboard-issues.
For more options, visit https://groups.google.com/d/optout.

Reply via email to