pyramid.tweens

excview_tween_factory(handler, registry)[ソース]

A tween factory which produces a tween that catches an exception raised by downstream tweens (or the main Pyramid request handler) and, if possible, converts it into a Response using an exception view.

バージョン 1.9 で変更: The request.response will be remain unchanged even if the tween handles an exception. Previously it was deleted after handling an exception.

Also, request.exception and request.exc_info are only set if the tween handles an exception and returns a response otherwise they are left at their original values.

MAIN

Constant representing the main Pyramid handling function, for use in under and over arguments to pyramid.config.Configurator.add_tween().

INGRESS

Constant representing the request ingress, for use in under and over arguments to pyramid.config.Configurator.add_tween().

EXCVIEW

Constant representing the exception view tween, for use in under and over arguments to pyramid.config.Configurator.add_tween().