Skip to content

Investigate options for forbidding throwing exceptions in specific directories. #210

Open
@herregroen

Description

@herregroen

In our integrations directory we have all our classes that hook into WordPress filters and actions. As any exceptions thrown here in public functions wouldn't be able to be caught by us these would likely lead to fatals.

So ideally we'd be able to specify directories where throwing exceptions would be forbidden in public functions under the expectations that these would be hooked into WordPress filters ( if it's possible to detect which functions are hooked into filters or actions that would be excellent as well but I can see that being rather more difficult ).

So the following code would be forbidden only in public functions in a given directory:

throw new Exception( "Error!" );

While the following would be allowed:

return false;

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions