Better messages on common exceptions.

Not part of the build.
This commit is contained in:
mhammond@skippinet.com.au
2002-03-01 06:27:54 +00:00
parent ff5a6b2365
commit aa609aa1b9

View File

@@ -122,7 +122,12 @@ class _Interface:
class _Interfaces(_ComponentCollection):
def _get_one(self, name):
item = interfaceInfoManager.GetInfoForName(name)
try:
item = interfaceInfoManager.GetInfoForName(name)
except xpcom.COMException, why:
# Present a better exception message, and give a more useful error code.
import nsError
raise xpcom.COMException(nsError.NS_ERROR_NO_INTERFACE, "The interface '%s' does not exist" % (name,))
return _Interface(item.GetName(), item.GetIID())
def _build_dict(self):