|
@@ -13,23 +13,10 @@ To solve this problem you would have to write custom error views and handlers th
|
|
Misago views too have to solve this problem and this reason is why error handling boilerplate is part of framework.
|
|
Misago views too have to solve this problem and this reason is why error handling boilerplate is part of framework.
|
|
|
|
|
|
|
|
|
|
-Http404
|
|
|
|
-=======
|
|
|
|
-
|
|
|
|
-:py:class:`misago.views.exceptions.Http404`
|
|
|
|
-
|
|
|
|
-Misago's Http404 exception subclasses `Django Http404 <https://docs.djangoproject.com/en/dev/topics/http/views/#the-http404-exception>`_, but changes nothing about its implementation and exists simply to delegate 404 error handling to Misago's exceptions handler.
|
|
|
|
-
|
|
|
|
-Raise this exception if requested page does not exists or user's permission set shows that he shouldn't know if it exists. If you want to, you can insert custom error message into exception's constructor to be displayed by error page instead of default one.
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- raise Http404("Requested thread could not be found. Perhaps it was moved or deleted?")
|
|
|
|
-
|
|
|
|
-
|
|
|
|
OutdatedUrl
|
|
OutdatedUrl
|
|
===========
|
|
===========
|
|
|
|
|
|
-:py:class:`misago.views.exceptions.OutdatedUrl`
|
|
|
|
|
|
+:py:class:`misago.core.exceptions.OutdatedUrl`
|
|
|
|
|
|
OutdatedUrl exception is special "message" that tells Misago to return `permanent <http://en.wikipedia.org/wiki/HTTP_301>`_ redirection as response instead of intended view.
|
|
OutdatedUrl exception is special "message" that tells Misago to return `permanent <http://en.wikipedia.org/wiki/HTTP_301>`_ redirection as response instead of intended view.
|
|
|
|
|
|
@@ -38,22 +25,10 @@ This exception is raised by view utility that compares link's "slug" part agains
|
|
You should never raise this exception yourself, instead always return proper redirect response from your code.
|
|
You should never raise this exception yourself, instead always return proper redirect response from your code.
|
|
|
|
|
|
|
|
|
|
-PermissionDenied
|
|
|
|
-================
|
|
|
|
-
|
|
|
|
-:py:class:`misago.views.exceptions.PermissionDenied`
|
|
|
|
-
|
|
|
|
-Misago's PermissionDenied exception subclasses `Django PermissionDenied <https://docs.djangoproject.com/en/dev/ref/exceptions/#django.core.exceptions.PermissionDenied>`_, but changes nothing about its implementation and exists simply to delegate 403 error handling to Misago's exceptions handler.
|
|
|
|
-
|
|
|
|
-Raise this exception if user knows of requested page or action but has no permission to access or perform it. If you want to, you can insert custom error message into exception's constructor to be displayed by error page instead of default one.
|
|
|
|
-
|
|
|
|
- raise PermissionDenied("This thread is locked. You can't reply to it.")
|
|
|
|
-
|
|
|
|
-
|
|
|
|
Exception Handler
|
|
Exception Handler
|
|
=================
|
|
=================
|
|
|
|
|
|
-:py:mod:`misago.views.exceptions.handler`
|
|
|
|
|
|
+:py:mod:`misago.core.exceptionhandler`
|
|
|
|
|
|
Exception handler is lightweight system that pairs exceptions with special "handler" functions that turn those exceptions into valid HTTP responses that are then served back to client.
|
|
Exception handler is lightweight system that pairs exceptions with special "handler" functions that turn those exceptions into valid HTTP responses that are then served back to client.
|
|
|
|
|