priya-zha / Software-Engineering-Project

0 stars 2 forks source link

500 Internal Server Error : API need to handle request sent without file object #9

Closed Sekhar0799 closed 1 year ago

Sekhar0799 commented 1 year ago

Issue Description:

Current Behavior:

When the user calls the API without sending a file, the API returns a HTTP status code 500 error, causing an unexpected and uninformative response to the user.

Expected Behavior:

The API should be modified to handle cases where no file is received in the API request. Ideally, it should return a meaningful message, such as "Please send an image" or "No file part sent in the request," to assist users in understanding the error and facilitating smoother integration.

Before Fix:

image

After Fix:

image
Sekhar0799 commented 1 year ago

Fixed Solution: (Hanlde No files error) https://github.com/priya-zha/Software-Engineering-Project/blob/819ffb984459711b1de4ad685b564225d84de878/FlaskDetect.py#L242-L245

Sekhar0799 commented 1 year ago

Issue Resolved : refer https://github.com/priya-zha/Software-Engineering-Project/issues/9#issuecomment-1777787026