return error
This commit is contained in:
parent
e25f6cdb43
commit
5107eab67d
|
|
@ -38,13 +38,20 @@ async def chain_upsert_controller(
|
||||||
|
|
||||||
@router.get("/list")
|
@router.get("/list")
|
||||||
async def chain_list_controller(
|
async def chain_list_controller(
|
||||||
namespace_id: str, chain_repository: ChainRepositoryDependency
|
namespace_id: str,
|
||||||
|
chain_repository: ChainRepositoryDependency,
|
||||||
|
namespace_repository: NamespaceRepositoryDependency,
|
||||||
):
|
):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
assert await namespace_repository.get_by_id(namespace_id=namespace_id)
|
||||||
chains = await chain_repository.get_list(namespace_id=namespace_id)
|
chains = await chain_repository.get_list(namespace_id=namespace_id)
|
||||||
return chains
|
return chains
|
||||||
|
|
||||||
|
except AssertionError:
|
||||||
|
logger.exception(f"Unknown namespace_id {namespace_id}")
|
||||||
|
return HTTPException(status_code=400, detail="Wrong namespace_id")
|
||||||
|
|
||||||
except Exception:
|
except Exception:
|
||||||
logger.exception("Error during chain list")
|
logger.exception("Error during chain list")
|
||||||
return HTTPException(status_code=500, detail="Error during chain list")
|
return HTTPException(status_code=500, detail="Error during chain list")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user