formating CHttpException text

Hi there!

I’m using example found in Yii documentation to display user an error message:

throw new CHttpException(500, $error_text);

And I only wonder why I can’t use HTML formatting in such error-text?

When I use:

throw new CHttpException(500, '<strong>'.$error_text.'</strong>');

I got strong HTML tags added to the text while I supposed to see text in bold. How to achieve this?

Auto-reply: Exception messages are not formatted because for a reason beyond my imagination someone decided that yiic webapp will generate (along other files) an error.php file containing following code:

<?php echo CHtml::encode($message); ?>

Can’t figure out why someone decided that Exception shouldn’t be formatted, but to change it simply remove CHtml call:

<?php echo $message; ?>

Yii is shipped with some basic error/system views. You can use custom ones if needed, read this.