Skip to content

[core] Make a specific function for Page::display_error() so that themes can override it #1760

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 15, 2025

Conversation

shish
Copy link
Owner

@shish shish commented Apr 15, 2025

The default implementation of display_error() being to remove any existing Blocks, add a new Block with an error message, and then do the same stuff that display_page() does

    protected function display_error(): void
    {
        $error = $this->error;
        assert($error !== null);
        $this->set_code($error->http_code);
        $this->set_title("Error");
        $this->blocks = [];
        $this->add_block(new Block(null, \MicroHTML\SPAN($error->getMessage())));
        $this->display_page();
    }

@shish shish changed the title [core] fall back to fatal-error handler if there's an error in the user-error handler [core] Make a specific function for Page::display_error() so that themes can override it Apr 15, 2025
@shish shish merged commit 7c4bc22 into main Apr 15, 2025
31 checks passed
@shish shish deleted the pr1760 branch April 15, 2025 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant