From 2a2a1316e1b195c427c6a25de7fc2061e4928afe Mon Sep 17 00:00:00 2001 From: Wolfgang Hottgenroth Date: Tue, 15 Jul 2025 16:31:56 +0200 Subject: [PATCH] tune error messages, fix --- src/sbom_dt_dd_api.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sbom_dt_dd_api.py b/src/sbom_dt_dd_api.py index 5e22543..0242a1a 100644 --- a/src/sbom_dt_dd_api.py +++ b/src/sbom_dt_dd_api.py @@ -50,7 +50,7 @@ async def uploadMinimalSBOM( raise HTTPException(status_code=400, detail=f"yaml ScannerError: {e.context=}, {e.context_mark=}, {e.problem=}, {e.problem_mark=}, {e.note=}") except ApiException as e: logger.warning(f"uploadMinimalSBOM, ApiException: {type(e.cause)=}, {e.status=}, {e.reason=}, {e.body=}") - raise HTTPException(status_code=e.status, detail=f"{e.reason=}, {e.body=}, {e.data=}") + raise HTTPException(status_code=e.status, detail=f"{type(e.cause)=}, {e.reason=}, {e.body=}, {e.data=}") except Exception as e: logger.warning(f"uploadMinimalSBOM, Exception: {type(e)=}, {str(e)=}") raise HTTPException(status_code=500, detail=f"Exception: {type(e)=}, {str(e)=}") @@ -84,7 +84,7 @@ async def uploadSBOM( raise HTTPException(status_code=400, detail=f"JSON decoding error: {e.msg=}, {e.doc=}, {e.pos=}, {e.lineno=}, {e.colno=}") except ApiException as e: logger.warning(f"uploadSBOM, ApiException: {type(e.cause)=}, {e.status=}, {e.reason=}, {e.body=}") - raise HTTPException(status_code=e.status, detail=f"{e.reason=}, {e.body=}, {e.data=}") + raise HTTPException(status_code=e.status, detail=f"{type(e.cause)=}, {e.reason=}, {e.body=}, {e.data=}") except Exception as e: logger.warning(f"uploadSBOM, Exception: {type(e)=}, {str(e)=}") raise HTTPException(status_code=500, detail=f"Exception: {type(e)=}, {str(e)=}")