old_contents: import logging
  
  logger = logging.getLogger(__name__)
  
  
  class Result():
      def __init__(self, id=None):
          self.id = id
          self.ok = True
  
      def ok(self):
          return self.ok
  
  
  class BadResult(Result):
      def __init__(self):
          super().__init__()
          self.ok = False
  
  
  class Bus():
      def __init__(self):
          self.handlers = {}
  
      def register(self, command, handler):
          self.handlers[command] = handler
  
      def send(self, command):
          command_type = type(command)
          if command_type not in self.handlers:
              raise (Exception('No handler for command ' + str(command_type) + ' found'))
  
          try:
              id = self.handlers[command_type].handle(command)
              return Result(id)
          except Exception as e:
              logger.exception(e)
              return BadResult()
new_contents: import logging
  
  logger = logging.getLogger(__name__)
  
  
  class Result():
      def __init__(self, uid=None):
          self.id = uid
          self.ok = True
  
      def ok(self):
          return self.ok
  
  
  class BadResult(Result):
      def __init__(self):
          super().__init__()
          self.ok = False
  
  
  class Bus():
      def __init__(self):
          self.handlers = {}
  
      def register(self, command, handler):
          self.handlers[command] = handler
  
      def send(self, command):
          command_type = type(command)
          if command_type not in self.handlers:
              raise (Exception('No handler for command ' + str(command_type) + ' found'))
  
          try:
              uid = self.handlers[command_type].handle(command)
              return Result(uid)
          except Exception as e:
              logger.exception(e)
              return BadResult()
subject: refactor shadow name