好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

bottle error page

bottle error page

Error Pages ¶

If anything goes wrong Bottle displays an informative but fairly boring error page. You can override the default error pages using the error() decorator. It works similar to the route() decorator but expects an HTTP status code instead of a route:

<span class="nd">@error</span><span class="p">(</span><span class="mi">404</span><span class="p">)</span>
<span class="k">def</span> <span class="nf">error404</span><span class="p">(</span><span class="n">error</span><span class="p">):</span>
    <span class="k">return</span> <span class="s">'Nothing here, sorry'</span>

The error parameter passed to the error handler is an instance of HTTPError .



查看更多关于bottle error page的详细内容...

  阅读:41次