Plain Text Equivalent Of Chtml::errorsummary

Is there a plain text equivalent of




CHtml::errorSummary($model);



I want to return json formatted plain text error messages for my REST services.

$model->errors has them.

Not a plain text (multidim array), but you know how to deal with it.