Othernet-Project / librarian-core

GNU General Public License v3.0
1 stars 0 forks source link

Installing Routes doesn't fail noisily (it should) #4

Closed ben-en closed 8 years ago

ben-en commented 8 years ago

https://github.com/Outernet-Project/librarian-core/blob/master/librarian_core/supervisor.py#L102

If any errors occur on this line, they are suppressed. For instance, i used the following route.py which was trying to raise a KeyError, but no other error occured than a mako template error saying it couldn't find the route "twitter:default".

from librarian_core.contrib.templates.renderer import view

from .twitter import HANDLE_RE

EXPORTS = {
    'routes': {'required_by': ['librarian_core.contrib.system.routes.routes']}
}

@view('twitter')
def list_feed(handle):
    handles = handle.split(' ')
    return({'handles': handles})

def main_feed():
    list_feed('outernetforall')

def routes(config):
    return (
        ('twitter:list', list_feed, 'GET',
         '/content/<handle:re:{re}>'.format(HANDLE_RE), {}),
        ('twitter:default', main_feed, 'GET', '/tweets/', {}),
    )```
n0phx commented 8 years ago

Fixed in a519a111165cd207f16c73e14dad8f5c5e7ef2ea by making sure logging configuration is applied before anything else and from now on issues will be logged to stdout as well. However, component errors will still not prevent the app from loading, as that was the requested policy, they are just logged, but loading will continue. For this fix to take effect properly, the latest changes on feature/librarian-base branch must fetched as well.