예제 #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']