如何有效地管理和显示我的PHP应用程序中的错误?

I am trying to work out an effective way to catch and handle my errors. I am trying to build my own framework from scratch as an exercise.

I have many things to check and that throw errors if they don't exists or work as intended...

Here are some of the errors that exists around the framework...

For example, my Bootstrap.php file

enter image description here

and Container.php

enter image description here

So I am a bit confused about the overall architecture of 'gathering' these system errors together and displaying them... do I need to make a separate error class and error view and then just revert to the error view if an error is caught? Something like...

Error::handle('message here')

then in my Error.php file

class Error
{
    public function handle($message)
    {
        View::get('errors/error', $message);
    }
}