docs: def remote_command(function, self, *args, **kwargs):
      '''
      Catch `RuntimeError` exceptions raised by remote control board firmware
      commands and re-raise as more specific `FirmwareError` exception type,
      which includes command code and return code.
      '''
      try:
          return function(self, *args, **kwargs)
      except RuntimeError, exception:
          error_message = str(exception)
          match = CRE_REMOTE_ERROR.match(error_message)
          if match:
              # Exception message matches format of remote firmware error.
              command_code = int(match.group('command_int'))
              return_code = int(match.group('return_code_int'))
              raise FirmwareError(command_code, return_code)
  
          match = CRE_REMOTE_COMMAND_ERROR.match(error_message)
          if match:
              # Exception message matches format of remote firmware error.
              command_code = int(match.group('command_int'))
              command_name = NAMES_BY_COMMAND_CODE[command_code]
              raise RuntimeError(CRE_REMOTE_COMMAND_ERROR.sub(command_name,
                                                              error_message))
  
          # Not a remote firmware error, so raise original exception.
          raise