So ruby-wmi handled those exact cases, but it used an unreliable method, that of parsing the message. It's not clear to me that works on a localized system (WMI supports fully localization fairly deeply in its api), and even if it does there's no reason that strings can't change over OS updates / releases. Having the explicit type makes error handling clean in downstream code, but otherwise in terms of human debugging I don't think it improves things.
```ruby
        rescue => error
          case error.to_s
          when /Invalid class/i
            raise InvalidClass
          when /Invalid query/i
            raise InvalidQuery
          when /Invalid namespace/i
            raise InvalidNameSpace            
          end
        end
```