symfony API

sfException Class

« Back to API menu

action

addon

cache

config

controller

countable

database

debug

exception

filter

generator

helper

i18n

log

request

response

storage

test

user

util

validator

view

You are currently browsing the symfony documentation for the 1.0 version. Switch to:

sfException is the base class for all symfony related exceptions and provides an additional method for printing up a detailed view of an exception.

Method Summary

  • string formatArgs($args, $single = false, $format = 'html')
    Formats an array as a string.
  • __construct($message = null, $code)
    Class constructor.
  • setName($name)
    Sets the name of this exception.
  • string formatArrayAsHtml($values)
    Returns an HTML version of an array as YAML.
  • array getTraces((Exception) $exception, $format = 'plain')
    Returns an array of exception traces.
  • string getName()
    Retrieves the name of this exception.
  • printStackTrace((Exception) $exception = null)
    Prints the stack trace for this exception.
  • string fileExcerpt($file, $line)
    Returns an excerpt of a code file around the given line number.

Method Details

  • (string) formatArgs ($args, $single = false, $format = 'html')

    $args The argument array
    $format The format string (html or plain)

    Formats an array as a string.

  • __construct ($message = null, $code)

    $message The error message
    $code The error code

    Class constructor.

  • setName ($name)

    $name An exception name

    Sets the name of this exception.

  • (string) formatArrayAsHtml ($values)

    $values The values array

    Returns an HTML version of an array as YAML.

    returns An HTML string

  • (array) getTraces ((Exception) $exception, $format = 'plain')

    $exception An Exception implementation instance
    $format The trace format (plain or html)

    Returns an array of exception traces.

    returns An array of traces

  • (string) getName ()

    Retrieves the name of this exception.

    returns This exception's name

  • printStackTrace ((Exception) $exception = null)

    $exception An Exception implementation instance

    Prints the stack trace for this exception.

  • (string) fileExcerpt ($file, $line)

    $file A file path
    $line The selected line number

    Returns an excerpt of a code file around the given line number.

    returns An HTML string