Skip navigation links

Package org.takes.facets.fallback

Fallback.

See: Description

Package org.takes.facets.fallback Description

Fallback.

Exception handing in the framework is very simple and very intuitive. All you need to do is to wrap your "take" into TkFallback decorator and create a fallback that dispatches exceptions, for example:

 Take take = new TkFallback(
   original_take,
   new FbChain(
     new FbOnStatus(404, new TkHTML("page not found")),
     new FbOnStatus(405, new TkHTML("this method not allowed")),
     new FbFixed(new RsText("oops, some big problem"))
   )
 );

If and when exception occurs, TkFallback will catch it and create an instance of RqFallback. This object will be sent to the encapsulated instance of Fallback. It is recommended to use FbChain to dispatch a request through a series of fallbacks. The first of them who will return some response will stop the chain.

Since:
0.1
Version:
$Id: 70baa5ab7e9f0835a697d57e90e7cb458a891cf5 $
Author:
Yegor Bugayenko ([email protected])
Skip navigation links

Copyright © 2015–2018 Take. All rights reserved.