Changeset 38534 in vbox
- Timestamp:
- Aug 25, 2011 3:50:21 PM (13 years ago)
- Location:
- trunk/src/VBox/Main/src-server
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/ApplianceImplImport.cpp
r38491 r38534 837 837 if (RT_FAILURE(vrc)) 838 838 { 839 rc = E_FAIL;839 rc = setError(VBOX_E_IPRT_ERROR, "Creation of the VD interface failed (%Rrc)", vrc); 840 840 break; 841 841 } … … 899 899 if (RT_FAILURE(vrc)) 900 900 { 901 rc = E_FAIL;901 rc = setError(VBOX_E_IPRT_ERROR, "Creation of the VD interface failed (%Rrc)", vrc); 902 902 break; 903 903 } … … 1238 1238 pSha1Io = Sha1CreateInterface(); 1239 1239 if (!pSha1Io) 1240 throw E_OUTOFMEMORY;1240 throw setError(E_OUTOFMEMORY); 1241 1241 pFileIo = FileCreateInterface(); 1242 1242 if (!pFileIo) 1243 throw E_OUTOFMEMORY;1243 throw setError(E_OUTOFMEMORY); 1244 1244 1245 1245 SHA1STORAGE storage; … … 1250 1250 &storage.pVDImageIfaces); 1251 1251 if (RT_FAILURE(vrc)) 1252 throw E_FAIL;1252 throw setError(VBOX_E_IPRT_ERROR, "Creation of the VD interface failed (%Rrc)", vrc); 1253 1253 1254 1254 size_t cbMfSize = 0; … … 1314 1314 pSha1Io = Sha1CreateInterface(); 1315 1315 if (!pSha1Io) 1316 throw E_OUTOFMEMORY;1316 throw setError(E_OUTOFMEMORY); 1317 1317 pTarIo = TarCreateInterface(); 1318 1318 if (!pTarIo) 1319 throw E_OUTOFMEMORY;1319 throw setError(E_OUTOFMEMORY); 1320 1320 1321 1321 SHA1STORAGE storage; … … 1325 1325 &storage.pVDImageIfaces); 1326 1326 if (RT_FAILURE(vrc)) 1327 throw setError( E_FAIL,1328 tr(" Internal error(%Rrc)"), vrc);1327 throw setError(VBOX_E_IPRT_ERROR, 1328 tr("Creation of the VD interface failed (%Rrc)"), vrc); 1329 1329 1330 1330 /* Read the file name of the first file (need to be the ovf file). This … … 1332 1332 vrc = RTTarCurrentFile(tar, &pszFilename); 1333 1333 if (RT_FAILURE(vrc)) 1334 throw setError( E_FAIL,1335 tr(" Internal error(%Rrc)"), vrc);1334 throw setError(VBOX_E_IPRT_ERROR, 1335 tr("Getting the current file within the archive failed (%Rrc)"), vrc); 1336 1336 /* Skip the OVF file, cause this was read in IAppliance::Read already. */ 1337 1337 vrc = RTTarSeekNextFile(tar); 1338 1338 if ( RT_FAILURE(vrc) 1339 1339 && vrc != VERR_TAR_END_OF_FILE) 1340 throw setError( E_FAIL,1341 tr(" Internal error(%Rrc)"), vrc);1340 throw setError(VBOX_E_IPRT_ERROR, 1341 tr("Seeking within the archive failed (%Rrc)"), vrc); 1342 1342 1343 1343 PVDINTERFACEIO pCallbacks = pSha1Io; … … 1630 1630 } 1631 1631 else if (vrc != VERR_TAR_END_OF_FILE) 1632 rc = E_FAIL;1632 rc = setError(VBOX_E_IPRT_ERROR, "Seeking within the archive failed (%Rrc)", vrc); 1633 1633 1634 1634 return rc; -
trunk/src/VBox/Main/src-server/MachineImpl.cpp
r38499 r38534 4792 4792 rc = pProgress2->COMGETTER(ResultCode)(&iRc); 4793 4793 if (FAILED(rc)) throw rc; 4794 /* If the thread of the progress object has an error, then 4795 * retrieve the error info from there, or it'll be lost. */ 4794 4796 if (FAILED(iRc)) 4795 { 4796 /* If the thread of the progress object has an error, then 4797 * retrieve the error info from there, or it'll be lost. */ 4798 ProgressErrorInfo info(pProgress2); 4799 throw setError(iRc, Utf8Str(info.getText()).c_str()); 4800 } 4797 throw setError(ProgressErrorInfo(pProgress2)); 4801 4798 } 4802 4799 setMachineState(oldState); -
trunk/src/VBox/Main/src-server/MachineImplCloneVM.cpp
r38428 r38534 733 733 * IMachine corresponding to a mutable machine as d->pSrcMachine */ 734 734 if (d->pSrcMachine->isSessionMachine()) 735 throw E_FAIL;735 throw p->setError(E_INVALIDARG, "The source machine is mutable"); 736 736 737 737 /* Handle the special case that someone is requesting a _full_ clone … … 750 750 d->pSrcMachine = (Machine*)(IMachine*)newSrcMachine; 751 751 } 752 753 752 bool fSubtreeIncludesCurrent = false; 754 753 ComObjPtr<Machine> pCurrState; … … 765 764 if (FAILED(rc)) throw rc; 766 765 if (pCurr.isNull()) 767 throw E_FAIL;766 throw p->setError(VBOX_E_OBJECT_NOT_FOUND); 768 767 pCurrState = (Machine *)(IMachine *)pCurr; 769 768 ComPtr<ISnapshot> pSnapshot; … … 771 770 if (FAILED(rc)) throw rc; 772 771 if (pSnapshot.isNull()) 773 throw E_FAIL;772 throw p->setError(VBOX_E_OBJECT_NOT_FOUND); 774 773 ComPtr<IMachine> pCurrSnapMachine; 775 774 rc = pSnapshot->COMGETTER(Machine)(pCurrSnapMachine.asOutParam()); 776 775 if (FAILED(rc)) throw rc; 777 776 if (pCurrSnapMachine.isNull()) 778 throw E_FAIL;777 throw p->setError(VBOX_E_OBJECT_NOT_FOUND); 779 778 780 779 /* now check if there is a parent chain which leads to the … … 786 785 if (FAILED(rc)) throw rc; 787 786 if (pSnapMachine.isNull()) 788 throw E_FAIL;787 throw p->setError(VBOX_E_OBJECT_NOT_FOUND); 789 788 if (pSnapMachine == d->pSrcMachine) 790 789 { … … 840 839 { 841 840 if (pCurrState.isNull()) 842 throw E_FAIL;841 throw p->setError(VBOX_E_OBJECT_NOT_FOUND); 843 842 machineList.append(pCurrState); 844 843 } … … 1049 1048 ComObjPtr<Medium> pLMedium = static_cast<Medium*>(pTmp); 1050 1049 if (pLMedium.isNull()) 1051 throw E_POINTER;1050 throw p->setError(VBOX_E_OBJECT_NOT_FOUND); 1052 1051 ComObjPtr<Medium> pBase = pLMedium->getBase(); 1053 1052 if (pBase->isReadOnly()) … … 1179 1178 rc = progress2->COMGETTER(ResultCode)(&iRc); 1180 1179 if (FAILED(rc)) throw rc; 1180 /* If the thread of the progress object has an error, then 1181 * retrieve the error info from there, or it'll be lost. */ 1181 1182 if (FAILED(iRc)) 1182 { 1183 /* If the thread of the progress object has an error, then 1184 * retrieve the error info from there, or it'll be lost. */ 1185 ProgressErrorInfo info(progress2); 1186 throw p->setError(iRc, Utf8Str(info.getText()).c_str()); 1187 } 1183 throw p->setError(ProgressErrorInfo(progress2)); 1188 1184 /* Remember created medium. */ 1189 1185 newMedia.append(pTarget); … … 1229 1225 ComObjPtr<Medium> pLMedium = static_cast<Medium*>((IMedium*)mt.pMedium); 1230 1226 if (pLMedium.isNull()) 1231 throw E_POINTER;1227 throw p->setError(E_POINTER, "Returned object is empty"); 1232 1228 ComObjPtr<Medium> pBase = pLMedium->getBase(); 1233 1229 if (pBase->isReadOnly())
Note:
See TracChangeset
for help on using the changeset viewer.