- Timestamp:
- Jun 4, 2019 11:01:43 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/ApplianceImplImport.cpp
r78931 r78963 1813 1813 1814 1814 size_t cbWritten; 1815 RTVfsFileWrite(hVfsDstFile, pvBuffered, cbBuffered, &cbWritten);1815 vrc = RTVfsFileWrite(hVfsDstFile, pvBuffered, cbBuffered, &cbWritten); 1816 1816 if (RT_FAILURE(vrc)) 1817 1817 throw setErrorVrc(vrc, tr("Could not write into the file '%s' (%Rrc)"), strAbsDstPath.c_str(), vrc); … … 1820 1820 { 1821 1821 hrc = aRc; 1822 strLastActualErrorDesc = Utf8StrFmt("%s: Processing the downloaded object was failed. " 1823 "The exception (%Rrc)\n", __FUNCTION__, hrc); 1824 LogRel((strLastActualErrorDesc.c_str())); 1825 } 1826 catch (int aRc) 1827 { 1828 hrc = setErrorVrc(aRc); 1829 strLastActualErrorDesc = Utf8StrFmt("%s: Processing the downloaded object was failed. " 1830 "The exception (%Rrc)\n", __FUNCTION__, aRc); 1831 LogRel((strLastActualErrorDesc.c_str())); 1822 1832 } 1823 1833 catch (...) 1824 1834 { 1825 1835 hrc = VERR_UNEXPECTED_EXCEPTION; 1836 strLastActualErrorDesc = Utf8StrFmt("%s: Processing the downloaded object was failed. " 1837 "The exception (%Rrc)\n", __FUNCTION__, hrc); 1838 LogRel((strLastActualErrorDesc.c_str())); 1826 1839 } 1827 1840 1828 /* Don't forget to release all resources */ 1829 RTVfsFileRelease(hVfsDstFile); 1830 RTVfsIoStrmReadAllFree(pvBuffered, cbBuffered); 1831 1832 /*re-throw the error */ 1833 if (FAILED(hrc)) 1834 throw hrc; 1835 1841 // /* Don't forget to release all resources */ 1842 // RTVfsFileRelease(hVfsDstFile); 1843 // RTVfsIoStrmReadAllFree(pvBuffered, cbBuffered); 1836 1844 } 1837 1845 else … … 1950 1958 hVfsFssObject = NIL_RTVFSFSSTREAM; 1951 1959 1952 pTask->pProgress->SetNextOperation(BstrFmt(tr("Creating new VM '%s'", strVMName.c_str())).raw(), 50); 1953 /* Create the import stack to comply OVF logic. 1954 * Before we filled some other data structures which are needed by OVF logic too.*/ 1955 ImportStack stack(pTask->locInfo, m->pReader->m_mapDisks, pTask->pProgress, NIL_RTVFSFSSTREAM); 1956 i_importMachines(stack); 1960 if (SUCCEEDED(hrc)) 1961 { 1962 pTask->pProgress->SetNextOperation(BstrFmt(tr("Creating new VM '%s'", strVMName.c_str())).raw(), 50); 1963 /* Create the import stack to comply OVF logic. 1964 * Before we filled some other data structures which are needed by OVF logic too.*/ 1965 ImportStack stack(pTask->locInfo, m->pReader->m_mapDisks, pTask->pProgress, NIL_RTVFSFSSTREAM); 1966 i_importMachines(stack); 1967 } 1957 1968 1958 1969 } 1959 1970 catch (HRESULT aRc) 1960 1971 { 1961 LogRel(("%s: Cloud import (local phase) - exception occured (%Rrc).\n", __FUNCTION__, aRc));1962 1972 hrc = aRc; 1973 strLastActualErrorDesc = Utf8StrFmt("%s: Cloud import (local phase) failed. " 1974 "The exception (%Rrc)\n", __FUNCTION__, hrc); 1975 LogRel((strLastActualErrorDesc.c_str())); 1963 1976 } 1964 1977 catch (int aRc) 1965 1978 { 1966 LogRel(("%s: Cloud import (local phase) - exception occured (%Rrc).\n", __FUNCTION__, aRc));1967 1979 hrc = setErrorVrc(aRc); 1980 strLastActualErrorDesc = Utf8StrFmt("%s: Cloud import (local phase) failed. " 1981 "The exception (%Rrc)\n", __FUNCTION__, aRc); 1982 LogRel((strLastActualErrorDesc.c_str())); 1968 1983 } 1969 1984 catch (...) 1970 1985 { 1971 1986 hrc = VERR_UNRESOLVED_ERROR; 1972 LogRel(("%s: Cloud import (local phase) - Unknown exception occured.\n", __FUNCTION__)); 1973 } 1987 strLastActualErrorDesc = Utf8StrFmt("%s: Cloud import (local phase) failed. " 1988 "The exception (%Rrc)\n", __FUNCTION__, hrc); 1989 LogRel((strLastActualErrorDesc.c_str())); 1990 } 1991 1992 LogRel(("%s: Cloud import (local phase) final result (%Rrc).\n", __FUNCTION__, hrc)); 1974 1993 1975 1994 if (FAILED(hrc)) … … 1982 2001 if (hVfsFssObject != NIL_RTVFSFSSTREAM) 1983 2002 RTVfsFsStrmRelease(hVfsFssObject); 1984 1985 LogRel(("%s: Cloud import (local phase): original error was \'%s\'.\n", __FUNCTION__, strLastActualErrorDesc.c_str()));1986 2003 1987 2004 /* What to do here?
Note:
See TracChangeset
for help on using the changeset viewer.