The way I do it is through the HTML class my program uses.
function error($auth=NULL, $sel='', $message='Ahhh! Error in html::error(...). Redundant? Perhaps.') {
return(sprintf(html::fetchBasic(), 'Error', 'img/error.gif', html::menu($auth->priv, $sel), 'Error', $message));
}
Then to call it I just:
die(html::error(&$auth,'','Ah. Something Went Wrong.'));
And viola =)