UserException/ErrorAction from inside bootstraping Component not available?

Hello,

I have my component (extends from BaseObject) added to ‘bootstrap’ array, to get it init early.
This component throws my CustomException that extends from HttpException (which is extended from UserException).
It seems I’m not able to display the error nicely with the errorHandler component.
Isn’t it available at this moment?
Adding the ‘errorHandler’ component to the bootstrap array too, doesn’t have an effect.
If I just extend from Exception, the error is displayed with Yii’s nice representation with call stack, but not with the ErrorAction.
Is there a way to solve this?

Thanks in advance.

EDIT:
Odd thing is, the lifecycle says, the error handler is available before bootstrap():


Why doesn’t he show the graphical output of the error with the error.php view file of the error action?

HttpException is something related to browser, so that you can show some customize message to the user.
You can visit here: ( https://www.yiiframework.com/doc/guide/2.0/en/runtime-handling-errors ) to customize and how to handle it.

Hi ahmadasjad,

are you sure you understood my problem?
I already handle it. But I don’t get a “stylized” output of the Exception at this point of the application lifecycle, if it is a subclass of HttpException.