cloudflare-php icon indicating copy to clipboard operation
cloudflare-php copied to clipboard

feat(Endpoints\DNS): getRecordID to throw exception like Zones::getZoneID

Open spenserhale opened this issue 4 years ago • 2 comments

Feature request to make the Endpoints match how they handle not finding the ID requested. Throw appears to be the better pattern since the return type. Since previous was returning false and casting it to empty string due to return type, but for better future proof and possible issues with strict mode would be safer to throw.

IMPORTANT: It will break existing logic that is written to expect empty string instead of throw. This change should be included in next major version bump.

spenserhale avatar Oct 01 '20 18:10 spenserhale

Closes issue: https://github.com/cloudflare/cloudflare-php/issues/140

spenserhale avatar Oct 01 '20 19:10 spenserhale

This should be a ResponseException to match exceptions like 'record already exist'.

Please commit this change otherwise it brakes code with a type error. It's not possible to catch this error unless you catch type exceptions (very bad!).

This issue is now hanging here for almost 3 years.

DimaVIII avatar Jul 19 '23 21:07 DimaVIII