X-Git-Url: https://git.llucax.com/software/pymin.git/blobdiff_plain/7dfccdecbf326e5f3355672cfa6e0b67697652af..31a4ad5fa2a20910d6faf28e3b481bcb232d3a6d:/pymindaemon.py?ds=inline 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)