# File cmpi.rb, line 283 def self.rc_to_exception rc return nil if rc == 0 klass = [nil, # 0 /** Success */ CMPI_RC_OK = 0, RCErrFailed, # 1 /** Generic failure */ CMPI_RC_ERR_FAILED = 1, RCErrAccessDenied, # 2 /** Specified user does not have access to perform the requested action */ CMPI_RC_ERR_ACCESS_DENIED = 2, RCErrInvalidNamespace, # 3 /** invalid namespace specified */ CMPI_RC_ERR_INVALID_NAMESPACE = 3, RCErrInvalidParameter, # 4 /** invalid parameter specified */ CMPI_RC_ERR_INVALID_PARAMETER = 4, RCErrInvalidClass, # 5 /** Invalid class specified */ CMPI_RC_ERR_INVALID_CLASS = 5, RCErrNotFound, # 6 /** Item was not found */ CMPI_RC_ERR_NOT_FOUND = 6, RCErrNotSupported, # 7 /** Operation not supported */ CMPI_RC_ERR_NOT_SUPPORTED = 7, RCErrClassHasChildren, # 8 /** Object has child objects */ CMPI_RC_ERR_CLASS_HAS_CHILDREN = 8, RCErrClassHasInstances, # 9 /** Object has instances */ CMPI_RC_ERR_CLASS_HAS_INSTANCES = 9, RCErrInvalidSuperclass, # 10 /** Invalid super class specified */ CMPI_RC_ERR_INVALID_SUPERCLASS = 10, RCErrAlreadyExists, # 11 /** specified object already exists */ CMPI_RC_ERR_ALREADY_EXISTS = 11, RCErrNoSuchProperty, # 12 /** Property does not exist */ CMPI_RC_ERR_NO_SUCH_PROPERTY = 12, RCErrTypeMismatch, # 13 /** This is a type mismatch */ CMPI_RC_ERR_TYPE_MISMATCH = 13, RCErrQueryLanguageNotSupported, # 14 /** Query language not supported */ CMPI_RC_ERR_QUERY_LANGUAGE_NOT_SUPPORTED = 14, RCErrInvalidQuery, # 15 /** Invalid query */ CMPI_RC_ERR_INVALID_QUERY = 15, RCErrMethodNotAvailable,# 16 /** Method is not available */ CMPI_RC_ERR_METHOD_NOT_AVAILABLE = 16, RCErrMethodNotFound # 17 /** could not find the specified method */ CMPI_RC_ERR_METHOD_NOT_FOUND = 17, ][rc] return RuntimeError unless klass klass end