SpamExperts / cpanel-addon

WHM/cPanel add-on for providing integration with SpamExperts services

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Show proper error when protection failed because of missing package feature

alexkiro opened this issue · comments

When toggling the protection status, if the SpamExperts feature is missing from the feature list of a domain's package we currently show this error message in the addon:

The protection status of example.com could not be changed to protected because API communication failed.

In Debug Logs:

Aug 11 06:17:54 saturn ProSpamFilter[441424]: [PanelSupport] Triggering 'hasFeatureEnabled' in class 'SpamFilter_PanelSupport_Cpanel'
Aug 11 06:17:54 saturn ProSpamFilter[441424]: [Hook] NOT ADDING Domain: 'example.com' due to be disabled on featurelist

Acceptance criteria

  • The error message should be improved to be reflect the actual error
  • This applies to domains, subdomains, addon domains and parked domains

Other notes

  • @catalin-sc should be able to help us with some phrasing here

Manually verified the feature according to the acceptance criteria. Will add automated tests for the case.

Added tests that verify the correct error message appears when toggling status for domains, subdomains, addon domains and parked domains that do not have the SpamExperts feature enabled.

@catalinDonici this has been reintegrated so needs to be re-verified, can you have someone look into this?

Verified.