示例#1
0
 def handler(res):
     if res.status_code == 412:
         raise DocumentRevisionError(res)
     elif res.status_code == 404 and res.error_code == 1202:
         return None
     elif res.status_code not in HTTP_OK:
         raise DocumentGetError(res)
     return res.body['vertex']
示例#2
0
 def handler(res):
     if res.status_code in {304, 412}:
         raise DocumentRevisionError(res)
     elif res.status_code == 404 and res.error_code == 1202:
         return None
     elif res.status_code in HTTP_OK:
         return res.body
     raise DocumentGetError(res)
示例#3
0
 def handler(res):
     if res.status_code not in HTTP_OK:
         raise DocumentGetError(res)
     return Cursor(self._conn, res.body)
示例#4
0
 def handler(res):
     if res.status_code not in HTTP_OK:
         raise DocumentGetError(res)
     return res.body['document']