Error view not getting correctly rendered when throwing CHttpExcepton from controller/filter-level.

For a language verification based on querystring thing, I need to throw an exception if it turns to be false.

As the approach intends to perform this verification before everything else, I am setting it up at either filter level or controller component.

The issue is, the rendered view is not getting any decoration applied to it.

Error actions is


public function actionError(){...}

, and it behavies normally when thrown from within an action


public function actionIndex(){throw new CHttpException...}

.

But is not working in this particular case.

It might have to do with exception thrown before any action or actionError gets ran, Any thoughts?

I’ll put it simpler:

when throwing CHttpException() from controller::action() - error view gets correctly rendered.

when throwing CHttpException() from controller::init() - error view gets INcorrectly rendered.

when throwing CHttpException() from controller::filter() - error view gets INcorrectly rendered.

With INconrrectly, I mean it looks like a bare controler::partialRender with no view decorations at all.

ANY THOUGHTS?. I think my error handling is ‘ok’, i mean, it works for other scenarios.

I think this is the normal behaviour of the app. Because I have also tried CController::beforeAction and CController::beforeRender with same results.

WIll still look for some alternative, but if you have any idea of how to achieve this let me know.