X-Git-Url: https://git.llucax.com/software/pymin.git/blobdiff_plain/7dfccdecbf326e5f3355672cfa6e0b67697652af..75851ace6d8369155b86d5f76d469b545533919f:/pymindaemon.py diff --git a/pymindaemon.py b/pymindaemon.py index c3fdda6..ae86197 100644 --- a/pymindaemon.py +++ b/pymindaemon.py @@ -65,11 +65,16 @@ class PyminDaemon(eventloop.EventLoop): if result is not None: result = serializer.serialize(result) response = u'OK ' + except dispatcher.Error, e: + result = unicode(e) + u'\n' + response = u'ERROR ' except Exception, e: - result = unicode(e) + import traceback + result = u'Internal server error' + traceback.print_exc() # TODO logging! response = u'ERROR ' if result is None: - response += u'0' + response += u'0\n' else: response += u'%d\n%s' % (len(result), result) self.file.sendto(response, addr)