Changeset 16909 in vbox for trunk/src/libs/xpcom18a4/python
- Timestamp:
- Feb 18, 2009 3:10:51 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/libs/xpcom18a4/python/src/ErrorUtils.cpp
r16903 r16909 250 250 bool gotMsg = false; 251 251 252 const RTCOMERRMSG* pMsg = RTErrCOMGet(r); 253 if (strncmp(pMsg->pszMsgFull, "Unknown", 7) != 0) 252 if (!gotMsg) 254 253 { 255 gotMsg = true; 256 PR_snprintf(msg, sizeof(msg), "%s (%s)", 257 pMsg->pszMsgFull, pMsg->pszDefine); 258 gotMsg = true; 259 } 260 261 nsresult rc; 262 nsCOMPtr <nsIExceptionService> es; 263 es = do_GetService (NS_EXCEPTIONSERVICE_CONTRACTID, &rc); 264 if (!gotMsg && NS_SUCCEEDED (rc)) 265 { 266 nsCOMPtr <nsIExceptionManager> em; 267 rc = es->GetCurrentExceptionManager (getter_AddRefs (em)); 254 nsresult rc; 255 nsCOMPtr <nsIExceptionService> es; 256 es = do_GetService (NS_EXCEPTIONSERVICE_CONTRACTID, &rc); 268 257 if (NS_SUCCEEDED (rc)) 269 258 { 270 nsCOMPtr <nsIException > ex;271 rc = e m->GetExceptionFromProvider(r, NULL, getter_AddRefs (ex));272 if (NS_SUCCEEDED (rc) && ex)259 nsCOMPtr <nsIExceptionManager> em; 260 rc = es->GetCurrentExceptionManager (getter_AddRefs (em)); 261 if (NS_SUCCEEDED (rc)) 273 262 { 274 nsXPIDLCString emsg; 275 ex->GetMessage(getter_Copies(emsg)); 276 PR_snprintf(msg, sizeof(msg), "%s", 277 emsg.get()); 278 gotMsg = true; 263 nsCOMPtr <nsIException> ex; 264 rc = em->GetExceptionFromProvider(r, NULL, getter_AddRefs (ex)); 265 if (NS_SUCCEEDED (rc) && ex) 266 { 267 nsXPIDLCString emsg; 268 ex->GetMessage(getter_Copies(emsg)); 269 PR_snprintf(msg, sizeof(msg), "%s", 270 emsg.get()); 271 gotMsg = true; 272 } 279 273 } 280 274 } … … 283 277 if (!gotMsg) 284 278 { 285 PR_snprintf(msg, sizeof(msg), "Error %d in module %d", 279 const RTCOMERRMSG* pMsg = RTErrCOMGet(r); 280 if (strncmp(pMsg->pszMsgFull, "Unknown", 7) != 0) 281 { 282 PR_snprintf(msg, sizeof(msg), "%s (%s)", 283 pMsg->pszMsgFull, pMsg->pszDefine); 284 gotMsg = true; 285 } 286 } 287 288 if (!gotMsg) 289 { 290 PR_snprintf(msg, sizeof(msg), "Error 0x%x in module 0x%x", 286 291 NS_ERROR_GET_CODE(r), NS_ERROR_GET_MODULE(r)); 287 292 }
Note:
See TracChangeset
for help on using the changeset viewer.