     @resource: (pattern) ->
         assert identify = @identify().underline.toString()
         regexify = (s) -> new RegExp "^#{RegExp.escape(s)}$"
-        pattern = regexify pattern if _.isString pattern
+        pattern = try 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"

        hostname = _.first request.headers.host.split ":"
        pdomain = (pattern) -> pattern.test hostname
        presource = (pattern) -> pattern.test pathname
        domainOk = _.some(domains, pdomain) or no
        resourceOk = _.some(resources, presource) or no
        matches = domainOk is yes and resourceOk is yes
        @emit "matches", matches, request, response

        hostname = _.first request.headers.host.split ":"
        pdomain = (p) -> gdomain = hostname.match p
        presource = (p) -> gresource = pathname.match p
        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"
