VirtualBox

Changeset 49585 in vbox


Ignore:
Timestamp:
Nov 20, 2013 1:55:39 PM (11 years ago)
Author:
vboxsync
Message:

pr7072. noninformative error messages from the function importMachineGeneric() have been fixed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-server/ApplianceImplImport.cpp

    r49489 r49585  
    29622962            stack.fSessionOpen = false;
    29632963        }
    2964         catch(HRESULT /* aRC */)
     2964        catch(HRESULT aRC)
    29652965        {
     2966            com::ErrorInfo info(this, COM_IIDOF(IAppliance));
     2967
    29662968            if (stack.fSessionOpen)
    29672969                stack.pSession->UnlockMachine();
    29682970
    2969             throw;
     2971            if (info.isFullAvailable())
     2972                throw setError(aRC, Utf8Str(info.getText()).c_str());
     2973            else
     2974                throw setError(aRC, "Unknown error during OVF import");
    29702975        }
    29712976    }
     
    30833088                                }
    30843089                                if (itDiskImage == stack.mapDisks.end())
    3085                                 {
    30863090                                    throw setError(E_FAIL,
    30873091                                                   tr("Internal inconsistency looking up disk image '%s'. "
    30883092                                                      "Check compliance OVA package structure and file names "
    3089                                                       "references in the section <References> in the OVF file."),
     3093                                                      "references in the section <References> in the OVF file"),
    30903094                                                   availableImage.c_str());
    3091                                 }
    30923095
    30933096                                /* replace with a new found disk image */
     
    31133116                                }
    31143117                                if (!vsdeTargetHD)
    3115                                 {
    31163118                                    /*
    31173119                                     * in this case it's an error because something wrong with OVF description file.
     
    31213123                                                   tr("Internal inconsistency looking up disk image '%s'"),
    31223124                                                   diCurrent.strHref.c_str());
    3123                                 }
    31243125
    31253126                                itVDisk = vsysThis.mapVirtualDisks.find(diCurrent.strDiskId);
     
    31663167                ComPtr<IMachine> sMachine;
    31673168                rc = stack.pSession->COMGETTER(Machine)(sMachine.asOutParam());
    3168                 if (FAILED(rc)) throw rc;
     3169                if (FAILED(rc))
     3170                    throw rc;
    31693171
    31703172                // find the hard disk controller to which we should attach
     
    31963198                                                 dvdImage.asOutParam());
    31973199
    3198                     if (FAILED(rc)) throw rc;
     3200                    if (FAILED(rc))
     3201                        throw rc;
    31993202
    32003203                    rc = sMachine->AttachDevice(mhda.controllerType.raw(),// wstring name
     
    32033206                                                DeviceType_DVD,           // DeviceType_T type
    32043207                                                dvdImage);
    3205                     if (FAILED(rc)) throw rc;
     3208                    if (FAILED(rc))
     3209                        throw rc;
    32063210                }
    32073211                else
     
    32133217                                                pTargetHD);
    32143218
    3215                     if (FAILED(rc)) throw rc;
     3219                    if (FAILED(rc))
     3220                        throw rc;
    32163221                }
    32173222
     
    32193224
    32203225                rc = sMachine->SaveSettings();
    3221                 if (FAILED(rc)) throw rc;
     3226                if (FAILED(rc))
     3227                    throw rc;
    32223228
    32233229                /* restore */
     
    32393245            // only now that we're done with all disks, close the session
    32403246            rc = stack.pSession->UnlockMachine();
    3241             if (FAILED(rc)) throw rc;
     3247
     3248            if (FAILED(rc))
     3249                throw rc;
     3250
    32423251            stack.fSessionOpen = false;
    32433252        }
    3244         catch(HRESULT /* aRC */)
     3253        catch(HRESULT  aRC)
    32453254        {
     3255            com::ErrorInfo info(this, COM_IIDOF(IAppliance));
     3256
    32463257            if (stack.fSessionOpen)
    32473258                stack.pSession->UnlockMachine();
    32483259
    3249             throw;
     3260            if (info.isFullAvailable())
     3261                throw setError(aRC, Utf8Str(info.getText()).c_str());
     3262            else
     3263                throw setError(aRC, "Unknown error during OVF import");
    32503264        }
    32513265    }
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette