Project

General

Profile

バグ #3760

意味のない例外処理を削除する

Added by n-miyamoto almost 5 years ago. Updated over 4 years ago.

Status:
終了
Priority:
通常
Assignee:
Start date:
12/19/2016
Due date:
% Done:

100%

Estimated time:

Description

以下のように意味のない箇所で例外処理を行っている部分があるため修正する。

    try:
      return self._sdoSvcProfiles
    except:
      self._rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception())
      raise SDOPackage.InternalError("get_service_profiles()")

Associated revisions

Revision 768 (diff)
Added by miyamoto almost 5 years ago

[compat,bugfix,->RELENG_1_2] fixed bug. refs #3760

History

#1 Updated by n-miyamoto almost 5 years ago

  • % Done changed from 0 to 50

以下の部分が該当するため、修正を行った。

  • SdoOrganization
    try:
      guard = OpenRTM_aist.ScopedLock(self._org_mutex)
      self._orgProperty = org_property
      return True
    except:
      self.__rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception())
      raise SDOPackage.InternalError("add_organization_property()")


    try:
      self._varOwner = sdo
      return True
    except:
      self.__rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception())
      raise SDOPackage.InternalError("set_owner()")
    try:
      return self._memberList
    except:
      self.__rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception())
      raise SDOPackage.InternalError("get_members()")
    try:
      self._memberList = sdos
      return True
    except:
      self.__rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception())
      raise SDOPackage.InternalError("set_members()")
    try:
      self._dependency = dependency
      return True
    except:
      self.__rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception())
      raise SDOPackage.InternalError("set_dependency(): Unknown.")
  • SdoConfiguration
    try:
      guard = OpenRTM_aist.ScopedLock(self._dprofile_mutex)
      self._deviceProfile = dProfile
    except:
      self._rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception())
      raise SDOPackage.InternalError("Unknown Error")
    try:
      if not self._configsets.haveConfig(config_id):
        self._rtcout.RTC_ERROR("No such ConfigurationSet")
        raise SDOPackage.InternalError("No such ConfigurationSet")
    except:
      self._rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception())
      raise SDOPackage.InternalError("Unknown exception")
  • RTObject
    try:
      return self._portAdmin.getPortServiceList()
    except:
      self._rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception())

    try:
      return self._sdoOwnedOrganizations
    except:
      self._rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception())
      raise SDOPackage.NotAvailable("NotAvailable: get_owned_organizations")

    try:
      return self._profile.instance_name
    except:
      self._rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception())
      raise SDOPackage.InternalError("get_sdo_id()")
    try:
      return self._profile.description
    except:
      self._rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception())
      raise SDOPackage.InternalError("get_sdo_type()")

    try:
      return self._SdoConfigImpl.getDeviceProfile()
    except:
      self._rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception())
      raise SDOPackage.InternalError("get_device_profile()")
    try:
      return self._sdoSvcProfiles
    except:
      self._rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception())
      raise SDOPackage.InternalError("get_service_profiles()")
    try:
      return self._sdoSvcProfiles[index].service
    except:
      self._rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception())
      raise SDOPackage.InternalError("get_service()")
    try:
      return self._SdoConfig
    except:
      self._rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception())
      raise SDOPackage.InternalError("get_configuration()")
    try:
      return self._sdoOrganizations
    except:
      self._rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception())
      raise SDOPackage.InternalError("get_organizations()")
    try:
      return self._sdoStatus
    except:
      self._rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception())
      raise SDOPackage.InternalError("get_status_list()")
  • Timer
    try:
      self.join()
    except:
      pass
  • TimeValue
    try:
      res = TimeValue()
    except:
      res = OpenRTM_aist.TimeValue()

#2 Updated by n-miyamoto almost 5 years ago

  • % Done changed from 50 to 70

以下の箇所の例外処理は無理やり変数を置き換えない限り網羅不可能なので削除

  • SdoConfiguration
    try:
      guard = OpenRTM_aist.ScopedLock(self._params_mutex)
      param = copy.copy(self._parameters)
      return param
    except:
      self._rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception())
      raise SDOPackage.InternalError("Configuration.get_configuration_parameters")
    try:
      config = SDOPackage.ConfigurationSet("","",[])
      toConfigurationSet(config, configset)
      return config
    except:
      self._rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception())
      raise SDOPackage.InternalError("Configuration::get_configuration_set()")

    try:
      OpenRTM_aist.CORBA_SeqUtil.push_back(self._organizations, org)
    except:
      self._rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception())
      raise SDOPackage.InternalError("Configuration.add_organization")
    try:
      OpenRTM_aist.CORBA_SeqUtil.erase(self._orgProperty.properties, index)
      return True
    except:
      self.__rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception())
      raise SDOPackage.InternalError("remove_organization_property_value()")

#3 Updated by n-miyamoto over 4 years ago

  • Status changed from 新規 to 解決
  • % Done changed from 70 to 100

#4 Updated by n-ando over 4 years ago

  • Status changed from 解決 to 終了

Also available in: Atom PDF