def failureAsJSON(failure):
 return dict(failure.__getstate__(), type=dict(__module__=failure.type.__module__, __name__=failure.type.__name__))

def failureAsJSON ( failure ) : return dict ( failure . __getstate__ ( ) , type = dict ( __module__ = failure . type . __module__ , __name__ = failure . type . __name__ ) )
convert a failure to a json-serializable data structure .