Skip to content
This repository was archived by the owner on Feb 5, 2026. It is now read-only.
This repository was archived by the owner on Feb 5, 2026. It is now read-only.

Extend error handling for ability schema validation #14

Description

@gziolo

Follow-up for:

REST API needs detailed error messages with HTTP status codes. While WP_Ability::execute() validates internally, it only returns false and logs with _doing_it_wrong(), which doesn't provide capturable error messages. Related code that handles it today:

https://github.com/WordPress/abilities-api/blob/trunk/includes/rest-api/endpoints/class-wp-rest-abilities-run-controller.php#L137L144

https://github.com/WordPress/abilities-api/blob/dd94fce1a6ba8930d39f2011fa1e6147f9759ad8/includes/rest-api/endpoints/class-wp-rest-abilities-run-controller.php#L164L169

Consider updating WP_Ability to return WP_Error for better error handling which would then simplify and unify the implementation in REST API controller.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions