scrapyd: log errors in API calls to the scrapyd log

This commit is contained in:
Pablo Hoffman 2012-09-04 14:22:21 -03:00
parent f4a17ec272
commit 241abcb8aa
1 changed files with 3 additions and 0 deletions

View File

@ -2,6 +2,8 @@ import traceback
import uuid
from cStringIO import StringIO
from twisted.python import log
from scrapy.utils.txweb import JsonResource
from .utils import get_spider_list
@ -17,6 +19,7 @@ class WsResource(JsonResource):
except Exception, e:
if self.root.debug:
return traceback.format_exc()
log.err()
r = {"status": "error", "message": str(e)}
return self.render_object(r, txrequest)