Added shared and developer sections.
git-svn-id: svn://10.0.0.236/trunk@186441 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
28
mozilla/webtools/addons/shared/lib/error.php
Normal file
28
mozilla/webtools/addons/shared/lib/error.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
/**
|
||||
* Basic error functions for triggering fatal runtime errors.
|
||||
* This class is generally called when a page load should be terminated because of bad inputs.
|
||||
*
|
||||
* @package amo
|
||||
* @subpackage lib
|
||||
*/
|
||||
|
||||
/**
|
||||
* @param string $errorMessage Message to display.
|
||||
* @param string $errorTemplate Template to call (defaults to error template).
|
||||
*/
|
||||
function triggerError($errorMessage=null,$errorTemplate='error.tpl')
|
||||
{
|
||||
$tpl =& new AMO_Smarty();
|
||||
|
||||
$tpl->assign(
|
||||
array(
|
||||
'error'=>$errorMessage,
|
||||
'content'=>$errorTemplate,
|
||||
'backtrace'=>debug_backtrace()
|
||||
)
|
||||
);
|
||||
|
||||
$tpl->display('inc/wrappers/nonav.tpl');
|
||||
exit;
|
||||
}
|
||||
Reference in New Issue
Block a user