code: def _dispatch(self, method, params):
          
          self._count += 1
  
          func = getattr(self, method)
          try:
              return func(*params)
          except Exception as e:
              traceback.print_exc()
              raise e
docs: Customise exception handling