Better messages on common exceptions.

Not part of the build.


git-svn-id: svn://10.0.0.236/trunk@115560 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
mhammond%skippinet.com.au
2002-03-01 06:27:54 +00:00
parent 034a317c33
commit 0d1e5c8014

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):