No-Error Objector

class moco_wrapper.util.objector.NoErrorObjector

This class works along the same lines as the DefaultObjector, but it does not convert error responses into actualy exceptions. Instead an ErrorResponse object will be returned.

Example usage:

from moco_wrapper.util.objector import NoErrorObjector
from moco_wrapper import Moco

no_err_objector = NoErrorObjector()
m = Moco(
    objector = no_err_objector
)
convert(requestor_response)

converts the data of a response object (for example json) into a python object

Parameters:requestor_response – response object (see Responses)
Returns:modified response object

Note

only moco_wrapper.util.response.ObjectResponse and moco_wrapper.util.response.PagedListResponse are object to this conversion. Error responses will not be touched by this objector.

Note

if the method get_class_name_from_request_url() that is used to find the right class for conversion, returns None, no conversion of objects will take place