public class GenericExceptionHandler

class.errorhandler.php #14

GenericExceptionHandler will handle any uncaught exceptions thrown in Symphony. Additionally, all errors in Symphony are raised to exceptions to be handled by this class. It is possible for Exceptions to be caught by their own ExceptionHandler which can override the render function so that it can be displayed to the user appropriately

Properties

static boolean $enabled

Whether the GenericExceptionHandler should handle exceptions defaults to true

Methods

static string handler(Exception $e)

The handler function is given an Exception and will call it's render function to display the Exception to a user. After calling the render function, the output is displayed and then exited to prevent any further logic from occurring.

Parameters
  • $e ExceptionThe Exception object

Returns

The result of the Exception's render function

static void initialise(Log $Log, Log|null $log)

The initialise function will set the exception_handler to the this class's handler function

Parameters
  • $log Log|nullAn instance of a Symphony Log object to write errors to

static string render(Exception $e)

The render function will take an Exception and output a HTML page

Parameters
  • $e ExceptionThe Exception object

Returns

An HTML string

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details