tune error messages, fix
This commit is contained in:
@@ -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=}")
|
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:
|
except ApiException as e:
|
||||||
logger.warning(f"uploadMinimalSBOM, ApiException: {type(e.cause)=}, {e.status=}, {e.reason=}, {e.body=}")
|
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:
|
except Exception as e:
|
||||||
logger.warning(f"uploadMinimalSBOM, Exception: {type(e)=}, {str(e)=}")
|
logger.warning(f"uploadMinimalSBOM, Exception: {type(e)=}, {str(e)=}")
|
||||||
raise HTTPException(status_code=500, detail=f"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=}")
|
raise HTTPException(status_code=400, detail=f"JSON decoding error: {e.msg=}, {e.doc=}, {e.pos=}, {e.lineno=}, {e.colno=}")
|
||||||
except ApiException as e:
|
except ApiException as e:
|
||||||
logger.warning(f"uploadSBOM, ApiException: {type(e.cause)=}, {e.status=}, {e.reason=}, {e.body=}")
|
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:
|
except Exception as e:
|
||||||
logger.warning(f"uploadSBOM, Exception: {type(e)=}, {str(e)=}")
|
logger.warning(f"uploadSBOM, Exception: {type(e)=}, {str(e)=}")
|
||||||
raise HTTPException(status_code=500, detail=f"Exception: {type(e)=}, {str(e)=}")
|
raise HTTPException(status_code=500, detail=f"Exception: {type(e)=}, {str(e)=}")
|
||||||
|
Reference in New Issue
Block a user