Exceptions hierarchy

class fantastico.exceptions.FantasticoError(msg=None, http_code=400)[source]
../_images/exceptions.png

FantasticoError is the base of all exceptions raised within fantastico framework. It describe common attributes that each concrete fantastico exception must provide. By default all fantastico exceptions inherit FantasticoError exception. We do this because each raised unhandled FantasticoError is map to a specific exception response. This strategy guarantees that at no moment errors will cause fantastico framework wsgi container to crash.

http_code[source]

This method returns the http code on which this exception is mapped.

class fantastico.exceptions.FantasticoControllerInvalidError(msg=None, http_code=400)[source]

This exception is raised whenever a method is decorated with fantastico.mvc.controller_decorators.Controller and the number of arguments is not correct. Usually developer forgot to add request as argument to the controller.

class fantastico.exceptions.FantasticoClassNotFoundError(msg=None, http_code=400)[source]

This exception is raised whenever code tries to dynamically import and instantiate a class which can not be resolved.

class fantastico.exceptions.FantasticoNotSupportedError(msg=None, http_code=400)[source]

This exception is raised whenever code tries to do an operation that is not supported.

class fantastico.exceptions.FantasticoSettingNotFoundError(msg=None, http_code=400)[source]

This exception is raised whenever code tries to obtain a setting that is not available in the current fantastico configuration.

class fantastico.exceptions.FantasticoDuplicateRouteError(msg=None, http_code=400)[source]

This exception is usually raised by routing engine when it detects duplicate routes.

class fantastico.exceptions.FantasticoNoRoutesError(msg=None, http_code=400)[source]

This exception is usually raised by routing engine when no loaders are configured or no routes are registered.

class fantastico.exceptions.FantasticoRouteNotFoundError(msg=None, http_code=400)[source]

This exception is usually raised by routing engine when a requested url is not registered.

class fantastico.exceptions.FantasticoNoRequestError(msg=None, http_code=400)[source]

This exception is usually raised when some components try to use fantastico.request from WSGI environ before fantastico.middleware.request_middleware.RequestMiddleware was executed.

class fantastico.exceptions.FantasticoContentTypeError(msg=None, http_code=400)[source]

This exception is usually thrown when a mismatch between request accept and response content type. In Fantastico we think it’s mandatory to fulfill requests correctly and to take in consideration sent headers.

class fantastico.exceptions.FantasticoHttpVerbNotSupported(http_verb)[source]

This exception is usually thrown when a route is accessed with an http verb which does not support.

http_verb[source]

This property returns the http verb that caused the problems.

class fantastico.exceptions.FantasticoTemplateNotFoundError(msg=None, http_code=400)[source]

This exception is usually thrown when a controller tries to load a template which it does not found.

class fantastico.exceptions.FantasticoIncompatibleClassError(msg=None, http_code=400)[source]

This exception is usually thrown when we want to decorate / inject / mixin a class into another class that does not support it. For instance, we want to build a fantastico.mvc.model_facade.ModelFacade with a class that does not extend BASEMODEL.

class fantastico.exceptions.FantasticoDbError(msg=None, http_code=400)[source]

This exception is usually thrown when a database exception occurs. For one good example where this is used see fantastico.mvc.model_facade.ModelFacade.

class fantastico.exceptions.FantasticoDbNotFoundError(msg=None, http_code=400)[source]

This exception is usually thrown when an entity does not exist but we try to update it. For one good example where this is used see fantastico.mvc.model_facade.ModelFacade.

class fantastico.exceptions.FantasticoInsufficientArgumentsError(msg=None, http_code=400)[source]

This exception is usually thrown when a component extension received wrong number of arguments. See fantastico.rendering.component.Component.

class fantastico.exceptions.FantasticoUrlInvokerError(msg=None, http_code=400)[source]

This exception is usually thrown when an internal url invoker fails. For instance, if a component reusage rendering fails then this exception is raised.