replace validators with datatypes

Change-Id: I446c4e14e24afa3f65e79c8b6e07eec3271532b0
This commit is contained in:
Enrico Faulhaber
2017-07-03 15:15:46 +02:00
parent a87e568b55
commit bc3253a01a
11 changed files with 233 additions and 438 deletions

View File

@ -43,6 +43,7 @@ import threading
from messages import *
from errors import *
from secop.lib.parsing import format_time
from secop.lib import formatExtendedStack, formatException
class Dispatcher(object):
@ -88,6 +89,7 @@ class Dispatcher(object):
errorclass=err.__class__.__name__,
errorinfo=[repr(err), str(msg)])
except (ValueError, TypeError) as err:
self.log.exception(err)
reply = msg.get_error(
errorclass='BadValue',
errorinfo=[repr(err), str(msg)])
@ -95,7 +97,7 @@ class Dispatcher(object):
self.log.exception(err)
reply = msg.get_error(
errorclass='InternalError',
errorinfo=[repr(err), str(msg)])
errorinfo=[formatException(), str(msg), formatExtendedStack()])
else:
self.log.debug('Can not handle msg %r' % msg)
reply = self.unhandled(conn, msg)