Handling inconsistencies among Twisted releases

This commit is contained in:
Francesco Piccinno 2013-10-01 14:36:44 +02:00
parent 56275b1b9c
commit cc8a93f185
1 changed files with 2 additions and 2 deletions

View File

@ -4,7 +4,7 @@ Scrapy web services extension
See docs/topics/webservice.rst
"""
from twisted.web import server, error
from twisted.web import server, resource
from scrapy.exceptions import NotConfigured
from scrapy import log, signals
@ -45,7 +45,7 @@ class JsonRpcResource(JsonResource):
newtarget = getattr(target, name)
return JsonRpcResource(self.crawler, newtarget)
except AttributeError:
return error.NoResource("No such child resource.")
return resource.ErrorPage(404, "No Such Resource", "No such child resource.")
def get_target(self):
return self._target