<?php
if(!isset($ex)){ $ex=new Exception(); } //it is, this just shuts up the IDE's whining.

?>
<script type="text/javascript">
    let content='<table><tr><th>Message</th><td>&nbsp;&nbsp;</td><td><?php echo $ex->getMessage(); ?></td></tr>';
content+='<tr><th>File</th><td>&nbsp;&nbsp;</td><td><?php echo str_replace('\\', '/',$ex->getFile())	; ?></td></tr>';
content+='<tr><th>Line</th><td>&nbsp;&nbsp;</td><td><?php echo str_replace('\\', '/',$ex->getLine())	; ?></td></tr>';
content+='<tr><th>Trace</th><td>&nbsp;&nbsp;</td><td>';
    <?php
    $trace=$ex->getTraceAsString();
    $trace=str_replace("\n","<br>",$trace);
    $trace=str_replace("'","&quot;",$trace);
    echo 'content+=\'.$trace.\';';
    ?>
content+='</td></tr>';
content+='</table>';
content=content.replace('<?php echo config::getWwwRoot(); ?>','');
ui.grid();
grid.box({
	classes:'r1 c1 h3 w3',
	title:'Error details',
	content:content
});
</script>
