Open
Description
API Issue Report
Title
DELETE /api/v1/settings/sources/{id} – Internal Server Error when deleting non-existing ID
Description
When attempting to delete a resource using a non-existing or invalid ID, the API throws a 500 Internal Server Error
. The response includes the message:
"message": "__clone method called on non-object"
This indicates that the system is attempting to clone a null or undefined object, likely due to the missing record.
Steps to Reproduce
Send a DELETE request to /api/v1/settings/sources/{non-existing-id}.
{
"message": "__clone method called on non-object",
"exception": "Error",
"file": "/vendor/prettus/l5-repository/src/Prettus/Repository/Eloquent/BaseRepository.php",
"line": 759,
...
}
Expected Result
API should return:
{
"message": "Source not found"
}
with HTTP status code 404 Not Found.
Actual Result
HTTP status: 500 Internal Server Error
Message: "__clone method called on non-object"
Stack trace points to Prettus BaseRepository.
Metadata
Metadata
Assignees
Labels
No labels