ManiaLib 1.0b1 API Reference

Abstract Class ErrorHandling

Description

Error handling

Error handling features and handlers

  • todo: doc explain error handling strategy
  • abstract:

Located in /libraries/ErrorHandling.class.php (line 18)


	
			
Method Summary
 static void exceptionErrorHandler ( $errno,  $errstr,  $errfile,  $errline)
 static void exceptionHandler ( $exception)
Methods
static exceptionErrorHandler (line 45)

Error handler

Converts standard PHP errors into ErrorException Usage (loaded by default in the MVC framework):

  1.  set_error_handler(array('ErrorHandling''exceptionErrorHandler'));

  • throws: ErrorException
void exceptionErrorHandler ( $errno,  $errstr,  $errfile,  $errline)
  • $errno
  • $errstr
  • $errfile
  • $errline
static exceptionHandler (line 71)

Exception handler Used to cleanly catch exceptions, and is also used as uncaught exception handler.

Prints a nice error message in manialink Usage for catching exceptions:

  1.  try
  2.  {
  3.      //...
  4.  }
  5.  catch(Exception $exception)
  6.  {
  7.      ErrorHandling::exceptionHandler($exception);
  8.  }
Usage for default exception handling:
  1.  set_exception_handler(array('ErrorHandling''exceptionHandler'));
Note: the MVC framework uses both by default

void exceptionHandler ( $exception)
  • Exception $exception