summaryrefslogtreecommitdiff
path: root/repoze/bfg/router.py
diff options
context:
space:
mode:
authorChris McDonough <chrism@agendaless.com>2009-09-30 03:27:28 +0000
committerChris McDonough <chrism@agendaless.com>2009-09-30 03:27:28 +0000
commitd75fe70228c89e3606e51a4d5775faf549252a90 (patch)
tree043a7334d49a7455b80789f1aab56e4238dbd6b0 /repoze/bfg/router.py
parent4be6ce73f41e09bf0f3e5df01d7f5aaf4f3137a6 (diff)
downloadpyramid-d75fe70228c89e3606e51a4d5775faf549252a90.tar.gz
pyramid-d75fe70228c89e3606e51a4d5775faf549252a90.tar.bz2
pyramid-d75fe70228c89e3606e51a4d5775faf549252a90.zip
- The import of ``repoze.bfg.view.NotFound`` is deprecated in favor of
``repoze.bfg.exceptions.NotFound``. The old location still functions, but emits a deprecation warning. - The import of ``repoze.bfg.security.Unauthorized`` is deprecated in favor of ``repoze.bfg.exceptions.Forbidden``. The old location still functions but emits a deprecation warning. The rename from ``Unauthorized`` to ``Forbidden`` brings parity to the the name of the exception and the system view it invokes when raised. - New ``repoze.bfg.exceptions`` module was created to house exceptions that were previously sprinkled through various modules. - An ``exceptions`` API chapter was added, documenting the new ``repoze.bfg.exceptions`` module.
Diffstat (limited to 'repoze/bfg/router.py')
-rw-r--r--repoze/bfg/router.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/repoze/bfg/router.py b/repoze/bfg/router.py
index ec6c5969a..e2b2b6830 100644
--- a/repoze/bfg/router.py
+++ b/repoze/bfg/router.py
@@ -23,18 +23,18 @@ from repoze.bfg.authorization import ACLAuthorizationPolicy
from repoze.bfg.events import NewRequest
from repoze.bfg.events import NewResponse
from repoze.bfg.events import WSGIApplicationCreatedEvent
+from repoze.bfg.exceptions import Forbidden
+from repoze.bfg.exceptions import NotFound
from repoze.bfg.log import make_stream_logger
from repoze.bfg.registry import Registry
from repoze.bfg.registry import populateRegistry
from repoze.bfg.request import request_factory
-from repoze.bfg.security import Unauthorized
from repoze.bfg.settings import Settings
from repoze.bfg.settings import get_options
from repoze.bfg.threadlocal import manager
from repoze.bfg.traversal import ModelGraphTraverser
from repoze.bfg.traversal import _traverse
from repoze.bfg.urldispatch import RoutesRootFactory
-from repoze.bfg.view import NotFound
from repoze.bfg.view import default_forbidden_view
from repoze.bfg.view import default_notfound_view
@@ -118,7 +118,7 @@ class Router(object):
else:
try:
response = view_callable(context, request)
- except Unauthorized, why:
+ except Forbidden, why:
msg = why[0]
environ = getattr(request, 'environ', {})
environ['repoze.bfg.message'] = msg