Changeset 92483 in vbox
- Timestamp:
- Nov 17, 2021 5:35:55 PM (3 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/globals
- Files:
-
- 2 edited
-
UIErrorString.cpp (modified) (2 diffs)
-
UIErrorString.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIErrorString.cpp
r90967 r92483 136 136 137 137 /* static */ 138 QString UIErrorString::simplifiedErrorInfo(const COMErrorInfo &comInfo, HRESULT wrapperRC /* = S_OK */) 139 { 140 return UIErrorString::errorInfoToSimpleString(comInfo, wrapperRC); 141 } 142 143 /* static */ 144 QString UIErrorString::simplifiedErrorInfo(const COMBaseWithEI &comWrapper) 145 { 146 Assert(comWrapper.lastRC() != S_OK); 147 return simplifiedErrorInfo(comWrapper.errorInfo(), comWrapper.lastRC()); 148 } 149 150 /* static */ 138 151 QString UIErrorString::errorInfoToString(const COMErrorInfo &comInfo, HRESULT wrapperRC) 139 152 { … … 218 231 } 219 232 233 /* static */ 234 QString UIErrorString::errorInfoToSimpleString(const COMErrorInfo &comInfo, HRESULT wrapperRC /* = S_OK */) 235 { 236 /* Compose complex details string with text and status code: */ 237 QString strFormatted; 238 239 /* Check if details text is NOT empty: */ 240 const QString strDetailsInfo = comInfo.text(); 241 if (!strDetailsInfo.isEmpty()) 242 strFormatted += strDetailsInfo; 243 244 /* Check if we have result code: */ 245 bool fHaveResultCode = false; 246 247 if (comInfo.isBasicAvailable()) 248 { 249 #ifdef VBOX_WS_WIN 250 fHaveResultCode = comInfo.isFullAvailable(); 251 #else 252 fHaveResultCode = true; 253 #endif 254 255 if (fHaveResultCode) 256 strFormatted += "; " + QString("Result Code: ") + formatRCFull(comInfo.resultCode()); 257 } 258 259 if ( FAILED(wrapperRC) 260 && (!fHaveResultCode || wrapperRC != comInfo.resultCode())) 261 strFormatted += "; " + QString("Callee RC: ") + formatRCFull(wrapperRC); 262 263 /* Check if we have next error queued: */ 264 if (comInfo.next()) 265 strFormatted += "; " + errorInfoToSimpleString(*comInfo.next()); 266 267 return strFormatted; 268 } -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIErrorString.h
r82968 r92483 58 58 static QString formatErrorInfo(const COMResult &comRc); 59 59 60 /** Returns simplified error information for passed @a comInfo and @a wrapperRC. */ 61 static QString simplifiedErrorInfo(const COMErrorInfo &comInfo, HRESULT wrapperRC = S_OK); 62 /** Returns simplified error information for passed @a comWrapper. */ 63 static QString simplifiedErrorInfo(const COMBaseWithEI &comWrapper); 64 60 65 private: 61 66 62 67 /** Converts passed @a comInfo and @a wrapperRC to string. */ 63 68 static QString errorInfoToString(const COMErrorInfo &comInfo, HRESULT wrapperRC = S_OK); 69 70 /** Converts passed @a comInfo and @a wrapperRC to simplified string. */ 71 static QString errorInfoToSimpleString(const COMErrorInfo &comInfo, HRESULT wrapperRC = S_OK); 64 72 }; 65 73
Note:
See TracChangeset
for help on using the changeset viewer.

