If you use the Blueprint.php class, there's this function that helps you identify which line of code that causes an error (in PHP):
CODE
function blueprintErrorHandler( $errno, $errstr, $errfile, $errline )
{
if ( $errno == E_USER_ERROR )
{
// Make sure we set the right content type
header( "Content-Type: application/ x-ywidget+xml" );
// Make sure not to cache. The Java client really cares.
header( "Cache-Control: no-cache" );
$writer = new XMLWriter();
$writer->openMemory();
$writer->setIndent( true );
$writer->startDocument('1.0','UTF-8');
$page = new Blueprint_Page();
$page->setHeader(new Blueprint_SimpleHeader( "Error - ".htmlentities( $errno ) ) );
$module = new Blueprint_Module();
$page->addModule( $module );
$module->addContent( new Blueprint_Block( htmlentities( $errstr ) ) );
$module->addContent( new Blueprint_Block( "File: ".htmlentities( $errfile ) ) );
$module->addContent( new Blueprint_Block( "Line: ".htmlentities( $errline ) ) );
$page->Emit( $writer );
print( $writer->outputMemory() );
exit();
}
}
set_error_handler( "blueprintErrorHandler" );
Of course you have to modify this to your own xml if you dont want to user the Blueprint class. For other error such as this:
QUOTE
Terjadi kesalahan!
Terjadi kesalahan saat memproses permintaan terakhir Anda!
Kami mengalami masalah saat memroses permintaan terakhir Anda! Harap coba lagi nanti. (Error Code: 404)
The last line
(Error Code: 404) is actually a regular HTTP Status:
HTTP Status codes