Skip to content

HTTP Response (PSR-7)

Updated View as Markdown

Exceptions

The framework still ships the legacy Phalcon\Http\Response service used by the MVC stack. Any exception thrown by it will be of type Phalcon\Http\Response\Exception.

Granular Exceptions

As of 5.13.1 the component raises granular subclasses of Phalcon\Http\Response\Exception so callers can catch a specific failure mode. Existing catch (Phalcon\Http\Response\Exception $e) blocks continue to work unchanged.

Class Parent Thrown when
Phalcon\Http\Response\Exceptions\NonStandardStatusCodeRequiresMessage Phalcon\Http\Response\Exception A status code outside the well-known list is set without an explicit reason phrase.
Phalcon\Http\Response\Exceptions\ResponseAlreadySent Phalcon\Http\Response\Exception send() is called on a response that has already been sent.
Phalcon\Http\Response\Exceptions\ResponseServiceUnavailable Phalcon\Http\Response\Exception The component needs the response service but the DI container has none registered.
Phalcon\Http\Response\Exceptions\UrlServiceUnavailable Phalcon\Http\Response\Exception redirect() is called but the DI container has no url service.
Navigation

Type to search…

↑↓ navigate↵ selectEsc close