Skip to content

DELETE /api/v1/settings/sources/{id} – Internal Server Error when deleting non-existing ID #114

Open
@sagarkumar-webkul

Description

@sagarkumar-webkul

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.

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions