aznasut commited on
Commit
57e11f3
·
1 Parent(s): 8ce60c0

change exception

Browse files
Files changed (1) hide show
  1. main.py +2 -2
main.py CHANGED
@@ -145,7 +145,7 @@ async def classify_image(file: UploadFile = File(None)):
145
 
146
  return FileImageDetectionResponse(**response_data)
147
 
148
- except PipelineException as e:
149
  logging.error("Error processing image: %s", str(e))
150
  raise HTTPException(
151
  status_code=500, detail=f"Error processing image: {str(e)}"
@@ -227,7 +227,7 @@ async def classify_images(request: ImageUrlsRequest):
227
 
228
  response_data.append(detection_result)
229
 
230
- except PipelineException as e:
231
  logging.error("Error processing image from %s: %s", image_url, str(e))
232
  raise HTTPException(
233
  status_code=500,
 
145
 
146
  return FileImageDetectionResponse(**response_data)
147
 
148
+ except Exception as e:
149
  logging.error("Error processing image: %s", str(e))
150
  raise HTTPException(
151
  status_code=500, detail=f"Error processing image: {str(e)}"
 
227
 
228
  response_data.append(detection_result)
229
 
230
+ except Exception as e:
231
  logging.error("Error processing image from %s: %s", image_url, str(e))
232
  raise HTTPException(
233
  status_code=500,