Skip to content

Internal Server Error on Deleting Non-Existent Marketing Campaign via DELETE /api/v1/settings/marketing/campaigns/{id} #158

@sagarkumar-webkul

Description

@sagarkumar-webkul

Title:

Internal Server Error on Deleting Non-Existent Marketing Campaign via DELETE /api/v1/settings/marketing/campaigns/{id}

Description:

When attempting to delete a marketing campaign that does not exist (e.g., ID 23), the API returns a 500 Internal Server Error with the message _clone method called on non-object, leaking stack trace and internal code paths.

Affected Endpoint:

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

Preconditions:

  • Campaign with ID 23 does not exist in the system.

Steps to Reproduce:

  1. Execute this curl command:
curl -X 'DELETE' \
  'http://<host>/api/v1/settings/marketing/campaigns/23' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer <access_token>'
  1. Observe the response.

Actual Result:

{
  "message": "_clone method called on non-object",
  "exception": "Error",
  ...
}

Expected Result:

{
  "message": "Campaign with ID 23 not found.",
  "status": 404
}

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