Changeset 73221 in vbox
- Timestamp:
- Jul 18, 2018 6:29:01 PM (7 years ago)
- svn:sync-xref-src-repo-rev:
- 123826
- Location:
- trunk/src/VBox/Main/src-server
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/CloudClientImpl.cpp
r73216 r73221 51 51 } 52 52 53 //CloudClient::CloudClient(CloudProviderId_T aCloudProvider)54 // : mParent(NULL)55 //{56 // LogRel(("CloudClient::CloudClient(CloudProviderId_T %d)\n", mCloudProvider));57 // mCloudProvider = aCloudProvider;58 //}59 60 53 HRESULT CloudClient::FinalConstruct() 61 54 { … … 130 123 if (FAILED(hrc)) 131 124 { 132 throwhrc;125 return hrc; 133 126 } 134 127 … … 171 164 { 172 165 LogRel(("CloudClient::getOperationParameters: %d, %s\n", aCloudOperation, aJsonString.c_str())); 173 HRESULT hrc = VERR_NOT_IMPLEMENTED; 174 166 HRESULT hrc = setErrorBoth(E_FAIL, VERR_NOT_IMPLEMENTED, tr("Not implemented")); 175 167 return hrc; 176 168 } … … 183 175 aCloudOperation, 184 176 aOpId.toString().c_str())); 185 HRESULT hrc = VERR_NOT_IMPLEMENTED;177 HRESULT hrc = setErrorBoth(E_FAIL, VERR_NOT_IMPLEMENTED, tr("Not implemented")); 186 178 return hrc; 187 179 } … … 191 183 { 192 184 LogRel(("CloudClient::runOperation: %s, %d\n", aOpId.toString().c_str(), aTimeout)); 193 HRESULT hrc = VERR_NOT_IMPLEMENTED;185 HRESULT hrc = setErrorBoth(E_FAIL, VERR_NOT_IMPLEMENTED, tr("Not implemented")); 194 186 return hrc; 195 187 } … … 205 197 *aLastTime, 206 198 *aResult)); 207 HRESULT hrc = VERR_NOT_IMPLEMENTED;199 HRESULT hrc = setErrorBoth(E_FAIL, VERR_NOT_IMPLEMENTED, tr("Not implemented")); 208 200 return hrc; 209 201 } … … 214 206 LogRel(("CloudClient::getOperationParameterNames: %d\n", aCloudOperation)); 215 207 aParameterNames.clear(); 216 HRESULT hrc = VERR_NOT_IMPLEMENTED;208 HRESULT hrc = setErrorBoth(E_FAIL, VERR_NOT_IMPLEMENTED, tr("Not implemented")); 217 209 return hrc; 218 210 } … … 228 220 aOpParameterDesc.c_str())); 229 221 aOpParameterValues.clear(); 230 HRESULT hrc = VERR_NOT_IMPLEMENTED;222 HRESULT hrc = setErrorBoth(E_FAIL, VERR_NOT_IMPLEMENTED, tr("Not implemented")); 231 223 return hrc; 232 224 } … … 241 233 } 242 234 243 HRESULT hrc = VERR_NOT_IMPLEMENTED;235 HRESULT hrc = setErrorBoth(E_FAIL, VERR_NOT_IMPLEMENTED, tr("Not implemented")); 244 236 return hrc; 245 237 } … … 286 278 if (FAILED(hrc)) 287 279 { 288 throwhrc;280 return hrc; 289 281 } 290 282 … … 427 419 aJsonString = strExportParametersToOCI; 428 420 else 429 hrc = VERR_NOT_IMPLEMENTED;421 hrc = setErrorBoth(E_FAIL, VERR_NOT_IMPLEMENTED, tr("Not implemented")); 430 422 return hrc; 431 423 } … … 438 430 aCloudOperation, 439 431 aOpId.toString().c_str())); 440 HRESULT hrc = VERR_NOT_IMPLEMENTED;432 HRESULT hrc = setErrorBoth(E_FAIL, VERR_NOT_IMPLEMENTED, tr("Not implemented")); 441 433 return hrc; 442 434 } … … 446 438 { 447 439 LogRel(("CloudClientOCI::runOperation: %s, %d\n", aOpId.toString().c_str(), aTimeout)); 448 HRESULT hrc = VERR_NOT_IMPLEMENTED;440 HRESULT hrc = setErrorBoth(E_FAIL, VERR_NOT_IMPLEMENTED, tr("Not implemented")); 449 441 return hrc; 450 442 } … … 460 452 *aLastTime, 461 453 *aResult)); 462 HRESULT hrc = VERR_NOT_IMPLEMENTED;454 HRESULT hrc = setErrorBoth(E_FAIL, VERR_NOT_IMPLEMENTED, tr("Not implemented")); 463 455 return hrc; 464 456 } … … 469 461 LogRel(("CloudClientOCI::getOperationParameterNames: %d\n", aCloudOperation)); 470 462 aParameterNames.clear(); 471 HRESULT hrc = VERR_NOT_IMPLEMENTED;463 HRESULT hrc = setErrorBoth(E_FAIL, VERR_NOT_IMPLEMENTED, tr("Not implemented")); 472 464 return hrc; 473 465 } … … 483 475 aOpParameterDesc.c_str())); 484 476 aOpParameterValues.clear(); 485 HRESULT hrc = VERR_NOT_IMPLEMENTED;477 HRESULT hrc = setErrorBoth(E_FAIL, VERR_NOT_IMPLEMENTED, tr("Not implemented")); 486 478 return hrc; 487 479 } … … 496 488 } 497 489 498 HRESULT hrc = VERR_NOT_IMPLEMENTED;499 return hrc; 500 } 501 490 HRESULT hrc = setErrorBoth(E_FAIL, VERR_NOT_IMPLEMENTED, tr("Not implemented")); 491 return hrc; 492 } 493 -
trunk/src/VBox/Main/src-server/CloudUserProfileListImpl.cpp
r73218 r73221 132 132 { 133 133 LogRel(("There are not any sections in the config\n")); 134 hrc = VWRN_NOT_FOUND;134 hrc = E_FAIL; 135 135 } 136 136 else //the last section hasn't a close tag (the close tag is just the beginning of next section) … … 149 149 HRESULT hrc = S_OK; 150 150 if (aSectionName.isEmpty()) 151 hrc = VERR_INVALID_PARAMETER; /** @todo r=bird: You're mixing error codes... */151 hrc = E_FAIL; 152 152 else 153 153 mSections.insert(make_pair(aSectionName, section)); … … 263 263 LogRel(("CloudUserProfileList::getSupportedPropertiesNames:\n")); 264 264 aPropertiesNames.clear(); 265 return VERR_NOT_IMPLEMENTED;265 return setErrorBoth(E_FAIL, VERR_NOT_IMPLEMENTED, tr("Not implemented")); 266 266 } 267 267 … … 269 269 { 270 270 LogRel(("CloudUserProfileList::readProfiles: %s\n", strConfigPath.c_str())); 271 return VERR_NOT_IMPLEMENTED;271 return setErrorBoth(E_FAIL, VERR_NOT_IMPLEMENTED, tr("Not implemented")); 272 272 } 273 273 … … 276 276 *aProvider = CloudProviderId_Unknown; 277 277 LogRel(("CloudUserProfileList::getProvider: %d\n", *aProvider)); 278 return VERR_NOT_IMPLEMENTED;278 return setErrorBoth(E_FAIL, VERR_NOT_IMPLEMENTED, tr("Not implemented")); 279 279 } 280 280 … … 284 284 { 285 285 LogRel(("CloudUserProfileList::createProfile: %s, %d, %d\n", aProfileName.c_str(), aNames.size(), aValues.size())); 286 return VERR_NOT_IMPLEMENTED;286 return setErrorBoth(E_FAIL, VERR_NOT_IMPLEMENTED, tr("Not implemented")); 287 287 } 288 288 … … 292 292 { 293 293 LogRel(("CloudUserProfileList::updateProfile: %s, %d, %d\n", aProfileName.c_str(), aNames.size(), aValues.size())); 294 return VERR_NOT_IMPLEMENTED;294 return setErrorBoth(E_FAIL, VERR_NOT_IMPLEMENTED, tr("Not implemented")); 295 295 } 296 296 … … 300 300 LogRel(("CloudUserProfileList::getStoredProfilesNames:\n")); 301 301 aProfilesNames.clear(); 302 return VERR_NOT_IMPLEMENTED;302 return setErrorBoth(E_FAIL, VERR_NOT_IMPLEMENTED, tr("Not implemented")); 303 303 } 304 304 … … 310 310 aReturnNames.clear(); 311 311 aReturnValues.clear(); 312 return VERR_NOT_IMPLEMENTED;312 return setErrorBoth(E_FAIL, VERR_NOT_IMPLEMENTED, tr("Not implemented")); 313 313 } 314 314 … … 317 317 { 318 318 LogRel(("CloudUserProfileList::getPropertyDescription: %s, %s\n", aName.c_str(), aDescription.c_str())); 319 return VERR_NOT_IMPLEMENTED;319 return setErrorBoth(E_FAIL, VERR_NOT_IMPLEMENTED, tr("Not implemented")); 320 320 } 321 321 … … 330 330 } 331 331 332 return VERR_NOT_IMPLEMENTED;332 return setErrorBoth(E_FAIL, VERR_NOT_IMPLEMENTED, tr("Not implemented")); 333 333 } 334 334 … … 408 408 if (FAILED(hrc)) 409 409 { 410 throw hrc; /** @todo r=bird: WTF? Try return it! */410 return hrc; 411 411 } 412 412 LogRel(("Successfully parsed %d profiles\n", mpProfiles->getNumberOfSections())); … … 416 416 { 417 417 LogRel(("Empty path to config file\n")); 418 hrc = VERR_INVALID_PARAMETER; /** @todo r=bird: You're mixing error codes... */418 hrc = setErrorBoth(E_FAIL, VERR_INVALID_PARAMETER, tr("Empty path to config file")); 419 419 } 420 420 … … 441 441 } 442 442 else 443 hrc = VERR_ALREADY_EXISTS;443 hrc = setErrorBoth(E_FAIL, VERR_ALREADY_EXISTS, tr("Profile '%s' has already exested"), aProfileName.c_str()); 444 444 445 445 return hrc; … … 464 464 } 465 465 else 466 hrc = VERR_NOT_FOUND; /** @todo r=bird: You're mixing error codes... */466 hrc = setErrorBoth(E_FAIL, VERR_NOT_FOUND, tr("Profile '%s' wasn't found"), aProfileName.c_str()); 467 467 468 468 return hrc; … … 474 474 aProfilesNames = mpProfiles->getSectionsNames(); 475 475 if (aProfilesNames.empty()) 476 hrc = VERR_NOT_FOUND; /** @todo r=bird: You're mixing error codes... */476 hrc = setErrorBoth(E_FAIL, VERR_NOT_FOUND, tr("There aren't any profiles in the config")); 477 477 478 478 return hrc; … … 503 503 } 504 504 else 505 hrc = VERR_NOT_FOUND; /** @todo r=bird: You're mixing error codes... */505 hrc = setErrorBoth(E_FAIL, VERR_NOT_FOUND, tr("Profile '%s' wasn't found"), aProfileName.c_str()); 506 506 507 507 return hrc; … … 545 545 hrc = mpProfiles->updateSection(aProfileName, aProfile); 546 546 else 547 hrc = VERR_NOT_FOUND; /** @todo r=bird: You're mixing error codes... */ 547 hrc = setErrorBoth(E_FAIL, VERR_NOT_FOUND, tr("Profile '%s' wasn't found"), aProfileName.c_str()); 548 548 549 549 550 return hrc; … … 572 573 aProfile = reqProfile; 573 574 else 574 hrc = VERR_NOT_FOUND; /** @todo r=bird: You're mixing error codes... */575 576 return hrc; 577 } 578 575 hrc = setErrorBoth(E_FAIL, VERR_NOT_FOUND, tr("Profile '%s' wasn't found"), aProfileName.c_str()); 576 577 return hrc; 578 } 579 -
trunk/src/VBox/Main/src-server/CloudUserProfileManagerImpl.cpp
r73218 r73221 147 147 } 148 148 else 149 /** @todo r=bird: You are constantly mixing up status codes. 150 * VERR_FILE_NOT_FOUND, VERR_INVALID_PARAMETER and VERR_NOT_FOUND are all VBox 151 * status codes. They don't work for HRESULT types, because that's for 152 * COM/XPCOM status codes. Here you should use setErrorBoth or setErrorVrc. */ 153 hrc = setError(VERR_FILE_NOT_FOUND, tr("Could not locate the config file '%s'"), szOciConfigPath); 149 hrc = setErrorBoth(E_FAIL, VERR_FILE_NOT_FOUND, tr("Could not locate the config file '%s'"), 150 szOciConfigPath); 154 151 } 155 152 else
Note:
See TracChangeset
for help on using the changeset viewer.