|
@@ -475,11 +475,11 @@ class pure_json_protocol(object):
|
475
|
475
|
status = STATUS_BUFFERING_UNHANDLED_REQUEST
|
476
|
476
|
data = None
|
477
|
477
|
else:
|
|
478
|
+ self.logger.debug("%s Executing callback %s to process received data", self.__log_prefix__(), callback.__name__)
|
478
|
479
|
try:
|
479
|
|
- self.logger.debug("%s Executing callback %s to process received data", self.__log_prefix__(), callback.__name__)
|
480
|
480
|
status, data = callback(msg, *args, **kwargs)
|
481
|
481
|
except Exception as e:
|
482
|
|
- logger.error('{lp} Exception raised. Check callback {callback_name}: "{message}" and it\'s return values for service_id {service_id} and data_id {data_id}'.format(lp=self.__log_prefix__(), callback_name=callback.__name__, message=str(e), service_id=repr(msg.get_service_id()), data_id=repr(msg.get_data_id())))
|
|
482
|
+ logger.error('{lp} Exception raised. Check callback {callback_name}: "{message}" and it\'s return values for {msg_info}'.format(lp=self.__log_prefix__(), callback_name=callback.__name__, message=str(e), msg_info=self.__get_message_name__(msg.get_service_id(), msg.get_data_id())))
|
483
|
483
|
status = STATUS_CALLBACK_ERROR
|
484
|
484
|
data = None
|
485
|
485
|
else:
|
|
@@ -490,7 +490,10 @@ class pure_json_protocol(object):
|
490
|
490
|
self.__buffer_received_data__(msg)
|
491
|
491
|
else:
|
492
|
492
|
self.logger.debug("%s Executing callback %s to process received data", self.__log_prefix__(), callback.__name__)
|
493
|
|
- callback(msg, *args, **kwargs)
|
|
493
|
+ try:
|
|
494
|
+ callback(msg, *args, **kwargs)
|
|
495
|
+ except Exception as e:
|
|
496
|
+ logger.error('{lp} Exception raised. Check callback {callback_name}: "{message}" for {msg_info}'.format(lp=self.__log_prefix__(), callback_name=callback.__name__, message=str(e), msg_info=self.__get_message_name__(msg.get_service_id(), msg.get_data_id())))
|
494
|
497
|
return # No response needed
|
495
|
498
|
self.send(self.__sid_response_dict__[msg.get_service_id()], msg.get_data_id(), data, status=status)
|
496
|
499
|
|