Skip to content

Catching exceptions during custom module bootstrap #5200

@Jefferson49

Description

@Jefferson49

If custom modules create PHP errors while they are loaded, webtrees catches exceptions and throws flash messages instead. This is a good feature to keep webtrees running and still inform the user.

I would like to propose the same procedure to be applied during module bootstrap. I successfully tried the following code, which catches exceptions while custom modules are booted:
main...Jefferson49:webtrees:Catch-exceptions-during-custom-module-boot

I do not have the full picture, if this would have unwanted side effects. If not, it would be straight forward to implement it simularly to loading.

Another advantage would be that I can detect the flash messages (after caught exceptions) in my custom module "Custom Module Manager". If a newly installed module creates errors, I can rollback the installation. Currently, it is not possible in the boot case (only in load case), since PHP errors during module boot stop webtrees.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions