Skip to content

500 Error on Deleting Non-Existent Marketing Event via DELETE /api/v1/settings/marketing/events/{id} #154

Description

@sagarkumar-webkul

Title:

500 Error on Deleting Non-Existent Marketing Event via DELETE /api/v1/settings/marketing/events/{id}

Description:

When a DELETE request is sent to /api/v1/settings/marketing/events/{id} using a non-existent ID, the API returns a 500 Internal Server Error with the message:
"clone method called on non-object".
This occurs due to the absence of a null check before cloning the model, and it should instead return a user-friendly 404 response.

Affected Endpoint:

  • DELETE /api/v1/settings/marketing/events/{id}

Preconditions:

  • Krayin REST API is running.
  • The given marketing event ID does not exist.

Steps to Reproduce:

  1. Send a DELETE request to /api/v1/settings/marketing/events/24 (assuming ID 24 does not exist).
  2. Observe the response.

Actual Result:

Image
  • HTTP 500 Internal Server Error
{
  "message": "clone method called on non-object",
  "exception": "Error",
  ...
}

Expected Result:

  • HTTP 404 Not Found
{
  "message": "Marketing event with ID 24 not found.",
  "status": 404
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions