MCPcopy Create free account
hub / github.com/tortoise/tortoise-orm / translate_exceptions

Function translate_exceptions

tortoise/backends/sqlite/client.py:39–49  ·  view source on GitHub ↗
(func: FuncType)

Source from the content-addressed store, hash-verified

37
38
39def translate_exceptions(func: FuncType) -> FuncType:
40 @wraps(func)
41 async def translate_exceptions_(self, query, *args) -> T:
42 try:
43 return await func(self, query, *args)
44 except sqlite3.OperationalError as exc:
45 raise OperationalError(exc)
46 except sqlite3.IntegrityError as exc:
47 raise IntegrityError(exc)
48
49 return translate_exceptions_
50
51
52class SqliteClient(BaseDBAsyncClient):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…