Bottle.py error routing
问题 Bottle.py ships with an import to handle throwing HTTPErrors and route to a function. Firstly, the documentation claims I can (and so do several examples): from bottle import error @error(500) def custom500(error): return 'my custom message' however, when importing this statement error is unresolved but on running the application ignores this and just directs me to the generic error page. I found a way to get around this by: from bottle import Bottle main = Bottle() @Bottle.error(main, 500)