         hostname = _.first request.headers.host.split ":"
         pdomain = (p) -> gdomain = hostname.match p
         presource = (p) -> gresource = pathname.match p
-        pdomain = _.find(domains, pdomain) or null
+        pdomain = try _.find(domains, pdomain) or null
         presource = _.find(resources, presource) or null
         assert gdomain isnt null, "missing the domain"
         assert gresource isnt null, "missing resource"

    @resource: (pattern) ->
        assert identify = @identify().underline.toString()
        regexify = (s) -> new RegExp "^#{RegExp.escape(s)}$"
        pattern = regexify pattern if _.isString pattern
        inspected = pattern.unescape()?.underline or pattern
        associate = "Associating #{inspected} resource with %s"
        notRegexp = "The #{inspected} is not a valid regexp"

    @domain: (pattern) ->
        assert identify = @identify().underline.toString()
        regexify = (s) -> new RegExp "^#{RegExp.escape(s)}$"
        pattern = try regexify pattern if _.isString pattern
        inspected = pattern.unescape()?.underline or pattern
        associate = "Associating #{inspected} domain with %s"
        notRegexp = "The #{inspected} is not a valid regexp"
