Yaf_Exception::__construct

(Yaf >=1.0.0)

Yaf_Exception::__construct — Construct a Yaf exception

Beschreibung

public function Yaf_Exception::__construct(string $message = "", int $code = 0)

Constructs a new Yaf_Exception. The code carries the Yaf error code that identifies the type of failure, and is exposed via Exception::getCode().

Parameter-Liste

message

The exception message.

code

The Yaf error code.

Rückgabewerte

No value is returned.

Beispiele

Beispiel #1 Yaf_Exception::__construct() example

<?php
throw new Yaf_Exception(
    "Failed to find the controller 'Product'",
    YAF_ERR_NOTFOUND_CONTROLLER /* 516 */
);
?>

Das oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:

PHP Fatal error:  Uncaught Yaf_Exception: Failed to find the controller 'Product' in /path/to/index.php:2

Siehe auch

+add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top