mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-14 15:52:11 +02:00
This commit is contained in:
parent
40f01c123b
commit
b1d1833234
5 changed files with 11 additions and 11 deletions
|
|
@ -25,7 +25,7 @@ def check_error(response):
|
|||
try:
|
||||
msg = response["error"]["message"]
|
||||
tp = response["error"]["type"]
|
||||
except:
|
||||
except KeyError:
|
||||
raise ApplicationException(response["error"])
|
||||
|
||||
raise ApplicationException(f"{tp}: {msg}")
|
||||
|
|
@ -208,7 +208,7 @@ class Api:
|
|||
try:
|
||||
# Parse the response as JSON
|
||||
object = resp.json()
|
||||
except:
|
||||
except ValueError:
|
||||
raise ProtocolException(f"Expected JSON response")
|
||||
|
||||
check_error(object)
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ def check_error(response):
|
|||
try:
|
||||
msg = response["error"]["message"]
|
||||
tp = response["error"]["type"]
|
||||
except:
|
||||
except KeyError:
|
||||
raise ApplicationException(response["error"])
|
||||
|
||||
raise ApplicationException(f"{tp}: {msg}")
|
||||
|
|
@ -88,7 +88,7 @@ class AsyncFlow:
|
|||
|
||||
try:
|
||||
obj = await resp.json()
|
||||
except:
|
||||
except (ValueError, aiohttp.ContentTypeError):
|
||||
raise ProtocolException(f"Expected JSON response")
|
||||
|
||||
check_error(obj)
|
||||
|
|
|
|||
|
|
@ -142,7 +142,7 @@ class AsyncSocketClient:
|
|||
for queue in self._pending.values():
|
||||
try:
|
||||
await queue.put({"error": str(e)})
|
||||
except:
|
||||
except asyncio.CancelledError :
|
||||
pass
|
||||
finally:
|
||||
self._connected = False
|
||||
|
|
|
|||
|
|
@ -201,7 +201,7 @@ class BulkClient:
|
|||
finally:
|
||||
try:
|
||||
loop.run_until_complete(async_gen.aclose())
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
async def _export_triples_async(self, flow: str) -> Iterator[Triple]:
|
||||
|
|
@ -299,7 +299,7 @@ class BulkClient:
|
|||
finally:
|
||||
try:
|
||||
loop.run_until_complete(async_gen.aclose())
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
async def _export_graph_embeddings_async(self, flow: str) -> Iterator[Dict[str, Any]]:
|
||||
|
|
@ -393,7 +393,7 @@ class BulkClient:
|
|||
finally:
|
||||
try:
|
||||
loop.run_until_complete(async_gen.aclose())
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
async def _export_document_embeddings_async(self, flow: str) -> Iterator[Dict[str, Any]]:
|
||||
|
|
@ -517,7 +517,7 @@ class BulkClient:
|
|||
finally:
|
||||
try:
|
||||
loop.run_until_complete(async_gen.aclose())
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
async def _export_entity_contexts_async(self, flow: str) -> Iterator[Dict[str, Any]]:
|
||||
|
|
|
|||
|
|
@ -254,7 +254,7 @@ class Config:
|
|||
)
|
||||
for v in object["values"]
|
||||
]
|
||||
except:
|
||||
except (KeyError, TypeError):
|
||||
raise ProtocolException(f"Response not formatted correctly")
|
||||
|
||||
def get_values_all_workspaces(self, type):
|
||||
|
|
@ -330,6 +330,6 @@ class Config:
|
|||
|
||||
try:
|
||||
return object["config"], object["version"]
|
||||
except:
|
||||
except KeyError:
|
||||
raise ProtocolException(f"Response not formatted correctly")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue