Fixed #101: Obscure error when strings in routing list.

This commit is contained in:
Andrew Godwin 2016-03-26 15:28:11 -07:00
parent 49d32a71e3
commit 40b2348600

View File

@ -24,7 +24,11 @@ class Router(object):
# Expand those entries recursively into a flat list of Routes
self.routing = []
for entry in routing:
self.routing.extend(entry.expand_routes())
try:
self.routing.extend(entry.expand_routes())
except AttributeError:
# It's not a valid route
raise ValueError("Encountered %r in routing config, which is not a valid route() or include()" % entry)
# Now go through that list and collect channel names into a set
self.channels = {
route.channel