def _convert_exception(exception):
 return {'errmsg': str(exception), 'errtype': exception.__class__.__name__}

def _convert_exception ( exception ) : return { 'errmsg' : str ( exception ) , 'errtype' : exception . __class__ . __name__ }
convert an exception into a failure document for publishing .