VirtualBox

Changeset 22302 in vbox for trunk/src/VBox/Main


Ignore:
Timestamp:
Aug 17, 2009 3:36:01 PM (15 years ago)
Author:
vboxsync
Message:

Main/XML: add XML line numbers to error messages

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/xml/Settings.cpp

    r22301 r22302  
    8585{
    8686public:
    87     ConfigFileError(const ConfigFileBase *file, const char *pcszFormat, ...)
     87    ConfigFileError(const ConfigFileBase *file,
     88                    const xml::Node *pNode,
     89                    const char *pcszFormat, ...)
    8890        : xml::LogicError()
    8991    {
     
    9395        va_end(args);
    9496
    95         Utf8StrFmt str("Error reading %s. %s", file->m->strFilename.c_str(), what.c_str());
     97        Utf8Str strLine;
     98        if (pNode)
     99            strLine = Utf8StrFmt(" (line %RU32)", pNode->getLineNumber());
     100
     101        Utf8StrFmt str("Error reading %s%s -- %s",
     102                       file->m->strFilename.c_str(),
     103                       strLine.c_str(),
     104                       what.c_str());
    96105
    97106        setWhat(str.c_str());
     
    121130        m->pelmRoot = m->pDoc->getRootElement();
    122131        if (!m->pelmRoot || !m->pelmRoot->nameEquals("VirtualBox"))
    123             throw ConfigFileError(this, N_("Root element in VirtualBox settings files must be \"VirtualBox\"."));
     132            throw ConfigFileError(this, NULL, N_("Root element in VirtualBox settings files must be \"VirtualBox\"."));
    124133
    125134        if (!(m->pelmRoot->getAttributeValue("version", m->strSettingsVersionFull)))
    126             throw ConfigFileError(this, N_("Required VirtualBox/@version attribute is missing"));
     135            throw ConfigFileError(this, m->pelmRoot, N_("Required VirtualBox/@version attribute is missing"));
    127136
    128137        m->sv = SettingsVersion_Null;
     
    145154
    146155        if (m->sv == SettingsVersion_Null)
    147             throw ConfigFileError(this, N_("Cannot handle settings version '%s'"), m->strSettingsVersionFull.c_str());
     156            throw ConfigFileError(this, m->pelmRoot, N_("Cannot handle settings version '%s'"), m->strSettingsVersionFull.c_str());
    148157    }
    149158    else
     
    188197
    189198    if (guid.isEmpty())
    190         throw ConfigFileError(this, N_("UUID \"%s\" has invalid format"), strUUID.c_str());
     199        throw ConfigFileError(this, NULL, N_("UUID \"%s\" has invalid format"), strUUID.c_str());
    191200}
    192201
     
    211220             && (pcsz[19] != 'Z')
    212221           )
    213             throw ConfigFileError(this, N_("Cannot handle ISO timestamp '%s': is not UTC date"), str.c_str());
     222            throw ConfigFileError(this, NULL, N_("Cannot handle ISO timestamp '%s': is not UTC date"), str.c_str());
    214223
    215224        int32_t yyyy;
     
    248257            }
    249258
    250             throw ConfigFileError(this, N_("Cannot parse ISO timestamp '%s': runtime error, %Rra"), str.c_str(), rc);
    251         }
    252 
    253         throw ConfigFileError(this, N_("Cannot parse ISO timestamp '%s': invalid format"), str.c_str());
     259            throw ConfigFileError(this, NULL, N_("Cannot parse ISO timestamp '%s': runtime error, %Rra"), str.c_str(), rc);
     260        }
     261
     262        throw ConfigFileError(this, NULL, N_("Cannot parse ISO timestamp '%s': invalid format"), str.c_str());
    254263    }
    255264}
     
    264273    RTTIME time;
    265274    if (!RTTimeExplode(&time, &stamp))
    266         throw ConfigFileError(this, N_("Timespec %lld ms is invalid"), RTTimeSpecGetMilli(&stamp));
     275        throw ConfigFileError(this, NULL, N_("Timespec %lld ms is invalid"), RTTimeSpecGetMilli(&stamp));
    267276
    268277    return Utf8StrFmt("%04ld-%02hd-%02hdT%02hd:%02hd:%02hdZ",
     
    311320                map[strName] = strValue;
    312321            else
    313                 throw ConfigFileError(this, N_("Required ExtraDataItem/@name or @value attribute is missing"));
    314         }
    315         else
    316             throw ConfigFileError(this, N_("Invalid element '%s' in ExtraData section"), pelmExtraDataItem->getName());
     322                throw ConfigFileError(this, pelmExtraDataItem, N_("Required ExtraDataItem/@name or @value attribute is missing"));
     323        }
    317324    }
    318325}
     
    360367                    flt.action = USBDeviceFilterAction_Hold;
    361368                else
    362                     throw ConfigFileError(this, N_("Invalid value '%s' in DeviceFilter/@action attribute"), strAction.c_str());
     369                    throw ConfigFileError(this, pelmLevel4Child, N_("Invalid value '%s' in DeviceFilter/@action attribute"), strAction.c_str());
    363370            }
    364371
     
    535542            }
    536543            else
    537                 throw ConfigFileError(this, N_("Required MachineEntry/@uuid or @src attribute is missing"));
     544                throw ConfigFileError(this, pelmChild1, N_("Required MachineEntry/@uuid or @src attribute is missing"));
    538545        }
    539546    }
     
    563570        {
    564571            if (!(elmMedium.getAttributeValue("format", med.strFormat)))
    565                 throw ConfigFileError(this, N_("Required HardDisk/@format attribute is missing"));
     572                throw ConfigFileError(this, &elmMedium, N_("Required HardDisk/@format attribute is missing"));
    566573
    567574            if (!(elmMedium.getAttributeValue("autoReset", med.fAutoReset)))
     
    578585                    med.hdType = HardDiskType_Writethrough;
    579586                else
    580                     throw ConfigFileError(this, N_("HardDisk/@type attribute must be one of Normal, Immutable or Writethrough"));
     587                    throw ConfigFileError(this, &elmMedium, N_("HardDisk/@type attribute must be one of Normal, Immutable or Writethrough"));
    581588            }
    582589        }
     
    602609                    med.properties[strPropName] = strPropValue;
    603610                else
    604                     throw ConfigFileError(this, N_("Required HardDisk/Property/@name or @value attribute is missing"));
     611                    throw ConfigFileError(this, pelmHDChild, N_("Required HardDisk/Property/@name or @value attribute is missing"));
    605612            }
    606613        }
     
    609616    }
    610617    else
    611         throw ConfigFileError(this, N_("Required %s/@uuid or @location attribute is missing"), elmMedium.getName());
     618        throw ConfigFileError(this, &elmMedium, N_("Required %s/@uuid or @location attribute is missing"), elmMedium.getName());
    612619}
    613620
     
    680687                llDhcpServers.push_back(srv);
    681688            else
    682                 throw ConfigFileError(this, N_("Required DHCPServer/@networkName, @IPAddress, @networkMask, @lowerIP, @upperIP or @enabled attribute is missing"));
     689                throw ConfigFileError(this, pelmServer, N_("Required DHCPServer/@networkName, @IPAddress, @networkMask, @lowerIP, @upperIP or @enabled attribute is missing"));
    683690        }
    684691    }
     
    969976
    970977        if (!pelmAdapter->getAttributeValue("slot", nic.ulSlot))
    971             throw ConfigFileError(this, N_("Required Adapter/@slot attribute is missing"));
     978            throw ConfigFileError(this, pelmAdapter, N_("Required Adapter/@slot attribute is missing"));
    972979
    973980        Utf8Str strTemp;
     
    985992                nic.type = NetworkAdapterType_I82545EM;
    986993            else
    987                 throw ConfigFileError(this, N_("Invalid value '%s' in Adapter/type attribute"), strTemp.c_str());
     994                throw ConfigFileError(this, pelmAdapter, N_("Invalid value '%s' in Adapter/@type attribute"), strTemp.c_str());
    988995        }
    989996
     
    10121019            nic.mode = NetworkAttachmentType_Internal;
    10131020            if (!pelmAdapterChild->getAttributeValue("name", nic.strName))    // required network name
    1014                 throw ConfigFileError(this, N_("Required InternalNetwork/name element is missing"));
     1021                throw ConfigFileError(this, pelmAdapterChild, N_("Required InternalNetwork/@name element is missing"));
    10151022        }
    10161023        else if ((pelmAdapterChild = pelmAdapter->findChildElement("HostOnlyInterface")))
     
    10181025            nic.mode = NetworkAttachmentType_HostOnly;
    10191026            if (!pelmAdapterChild->getAttributeValue("name", nic.strName))    // required network name
    1020                 throw ConfigFileError(this, N_("Required HostOnlyInterface/name element is missing"));
     1027                throw ConfigFileError(this, pelmAdapterChild, N_("Required HostOnlyInterface/@name element is missing"));
    10211028        }
    10221029        // else: default is NetworkAttachmentType_Null
     
    10401047        SerialPort port;
    10411048        if (!pelmPort->getAttributeValue("slot", port.ulSlot))
    1042             throw ConfigFileError(this, N_("Required UART/Port/@slot attribute is missing"));
     1049            throw ConfigFileError(this, pelmPort, N_("Required UART/Port/@slot attribute is missing"));
    10431050
    10441051        // slot must be unique
     
    10471054             ++it)
    10481055            if ((*it).ulSlot == port.ulSlot)
    1049                 throw ConfigFileError(this, N_("UART/Port/@slot attribute value %d is used twice, must be unique"), port.ulSlot);
     1056                throw ConfigFileError(this, pelmPort, N_("Invalid value %RU32 in UART/Port/@slot attribute: value is not unique"), port.ulSlot);
    10501057
    10511058        if (!pelmPort->getAttributeValue("enabled", port.fEnabled))
    1052             throw ConfigFileError(this, N_("Required UART/Port/@enabled attribute is missing"));
     1059            throw ConfigFileError(this, pelmPort, N_("Required UART/Port/@enabled attribute is missing"));
    10531060        if (!pelmPort->getAttributeValue("IOBase", port.ulIOBase))
    1054             throw ConfigFileError(this, N_("Required UART/Port/@IOBase attribute is missing"));
     1061            throw ConfigFileError(this, pelmPort, N_("Required UART/Port/@IOBase attribute is missing"));
    10551062        if (!pelmPort->getAttributeValue("IRQ", port.ulIRQ))
    1056             throw ConfigFileError(this, N_("Required UART/Port/@IRQ attribute is missing"));
     1063            throw ConfigFileError(this, pelmPort, N_("Required UART/Port/@IRQ attribute is missing"));
    10571064
    10581065        Utf8Str strPortMode;
    10591066        if (!pelmPort->getAttributeValue("hostMode", strPortMode))
    1060             throw ConfigFileError(this, N_("Required UART/Port/@hostMode attribute is missing"));
     1067            throw ConfigFileError(this, pelmPort, N_("Required UART/Port/@hostMode attribute is missing"));
    10611068        if (strPortMode == "RawFile")
    10621069            port.portMode = PortMode_RawFile;
     
    10681075            port.portMode = PortMode_Disconnected;
    10691076        else
    1070             throw ConfigFileError(this, N_("Invalid value '%s' in UART/Port/@hostMode attribute"), strPortMode.c_str());
     1077            throw ConfigFileError(this, pelmPort, N_("Invalid value '%s' in UART/Port/@hostMode attribute"), strPortMode.c_str());
    10711078
    10721079        pelmPort->getAttributeValue("path", port.strPath);
     
    10911098        ParallelPort port;
    10921099        if (!pelmPort->getAttributeValue("slot", port.ulSlot))
    1093             throw ConfigFileError(this, N_("Required LPT/Port/@slot attribute is missing"));
     1100            throw ConfigFileError(this, pelmPort, N_("Required LPT/Port/@slot attribute is missing"));
    10941101
    10951102        // slot must be unique
     
    10981105             ++it)
    10991106            if ((*it).ulSlot == port.ulSlot)
    1100                 throw ConfigFileError(this, N_("LPT/Port/@slot attribute value %d is used twice, must be unique"), port.ulSlot);
     1107                throw ConfigFileError(this, pelmPort, N_("Invalid value %RU32 in LPT/Port/@slot attribute: value is not unique"), port.ulSlot);
    11011108
    11021109        if (!pelmPort->getAttributeValue("enabled", port.fEnabled))
    1103             throw ConfigFileError(this, N_("Required LPT/Port/@enabled attribute is missing"));
     1110            throw ConfigFileError(this, pelmPort, N_("Required LPT/Port/@enabled attribute is missing"));
    11041111        if (!pelmPort->getAttributeValue("IOBase", port.ulIOBase))
    1105             throw ConfigFileError(this, N_("Required LPT/Port/@IOBase attribute is missing"));
     1112            throw ConfigFileError(this, pelmPort, N_("Required LPT/Port/@IOBase attribute is missing"));
    11061113        if (!pelmPort->getAttributeValue("IRQ", port.ulIRQ))
    1107             throw ConfigFileError(this, N_("Required LPT/Port/@IRQ attribute is missing"));
     1114            throw ConfigFileError(this, pelmPort, N_("Required LPT/Port/@IRQ attribute is missing"));
    11081115
    11091116        pelmPort->getAttributeValue("path", port.strPath);
     
    12021209                Utf8Str strDevice;
    12031210                if (!pelmOrder->getAttributeValue("position", ulPos))
    1204                     throw ConfigFileError(this, N_("Required Boot/Order/@position attribute is missing"));
     1211                    throw ConfigFileError(this, pelmOrder, N_("Required Boot/Order/@position attribute is missing"));
    12051212
    12061213                if (    ulPos < 1
     
    12081215                   )
    12091216                    throw ConfigFileError(this,
     1217                                          pelmOrder,
    12101218                                          N_("Invalid value '%RU32' in Boot/Order/@position: must be greater than 0 and less than %RU32"),
    12111219                                          ulPos,
     
    12151223
    12161224                if (hw.mapBootOrder.find(ulPos) != hw.mapBootOrder.end())
    1217                     throw ConfigFileError(this, N_("Invalid value '%RU32' in Boot/Order/@position: value is not unique"), ulPos);
     1225                    throw ConfigFileError(this, pelmOrder, N_("Invalid value '%RU32' in Boot/Order/@position: value is not unique"), ulPos);
    12181226
    12191227                if (!pelmOrder->getAttributeValue("device", strDevice))
    1220                     throw ConfigFileError(this, N_("Required Boot/Order/@device attribute is missing"));
     1228                    throw ConfigFileError(this, pelmOrder, N_("Required Boot/Order/@device attribute is missing"));
    12211229
    12221230                DeviceType_T type;
     
    12321240                    type = DeviceType_Network;
    12331241                else
    1234                     throw ConfigFileError(this, N_("Invalid value '%s' in Boot/Order/@device attribute"), strDevice.c_str());
     1242                    throw ConfigFileError(this, pelmOrder, N_("Invalid value '%s' in Boot/Order/@device attribute"), strDevice.c_str());
    12351243                hw.mapBootOrder[ulPos] = type;
    12361244            }
     
    12591267                    hw.vrdpSettings.authType = VRDPAuthType_External;
    12601268                else
    1261                     throw ConfigFileError(this, N_("Invalid value '%s' in RemoteDisplay/@authType attribute"), strAuthType.c_str());
     1269                    throw ConfigFileError(this, pelmHwChild, N_("Invalid value '%s' in RemoteDisplay/@authType attribute"), strAuthType.c_str());
    12621270            }
    12631271
     
    12921300                        hw.biosSettings.biosBootMenuMode = BIOSBootMenuMode_MessageAndMenu;
    12931301                    else
    1294                         throw ConfigFileError(this, N_("Invalid value '%s' in BootMenu/@mode attribute"), strBootMenuMode.c_str());
     1302                        throw ConfigFileError(this, pelmBIOSChild, N_("Invalid value '%s' in BootMenu/@mode attribute"), strBootMenuMode.c_str());
    12951303                }
    12961304            }
     
    13191327                        sctl.controllerType = StorageControllerType_ICH6;
    13201328                    else
    1321                         throw ConfigFileError(this, N_("Invalid value '%s' for IDEController/@type attribute"), strType.c_str());
     1329                        throw ConfigFileError(this, pelmBIOSChild, N_("Invalid value '%s' for IDEController/@type attribute"), strType.c_str());
    13221330                }
    13231331                sctl.ulPortCount = 2;
     
    13941402                    hw.audioAdapter.controllerType = AudioControllerType_AC97;
    13951403                else
    1396                     throw ConfigFileError(this, N_("Invalid value '%s' in AudioAdapter/@controller attribute"), strTemp.c_str());
     1404                    throw ConfigFileError(this, pelmHwChild, N_("Invalid value '%s' in AudioAdapter/@controller attribute"), strTemp.c_str());
    13971405            }
    13981406            if (pelmHwChild->getAttributeValue("driver", strTemp))
     
    14171425                    hw.audioAdapter.driverType = AudioDriverType_MMPM;
    14181426                else
    1419                     throw ConfigFileError(this, N_("Invalid value '%s' in AudioAdapter/@driver attribute"), strTemp.c_str());
     1427                    throw ConfigFileError(this, pelmHwChild, N_("Invalid value '%s' in AudioAdapter/@driver attribute"), strTemp.c_str());
    14201428            }
    14211429        }
     
    14471455                    hw.clipboardMode = ClipboardMode_Bidirectional;
    14481456                else
    1449                     throw ConfigFileError(this, N_("Invalid value '%s' in Clipbord/@mode attribute"), strTemp.c_str());
     1457                    throw ConfigFileError(this, pelmHwChild, N_("Invalid value '%s' in Clipbord/@mode attribute"), strTemp.c_str());
    14501458            }
    14511459        }
     
    14581466            readGuestProperties(*pelmHwChild, hw);
    14591467        else
    1460             throw ConfigFileError(this, N_("Invalid element '%s' in Hardware section"), pelmHwChild->getName());
     1468            throw ConfigFileError(this, pelmHwChild, N_("Invalid element '%s' in Hardware section"), pelmHwChild->getName());
    14611469    }
    14621470
    14631471    if (hw.ulMemorySizeMB == (uint32_t)-1)
    1464         throw ConfigFileError(this, N_("Required Memory/@RAMSize element/attribute is missing"));
     1472        throw ConfigFileError(this, &elmHardware, N_("Required Memory/@RAMSize element/attribute is missing"));
    14651473}
    14661474
     
    14991507
    15001508        if (!pelmAttachment->getAttributeValue("hardDisk", strUUID))
    1501             throw ConfigFileError(this, N_("Required HardDiskAttachment/@hardDisk attribute is missing"));
     1509            throw ConfigFileError(this, pelmAttachment, N_("Required HardDiskAttachment/@hardDisk attribute is missing"));
    15021510        parseUUID(att.uuid, strUUID);
    15031511
    15041512        if (!pelmAttachment->getAttributeValue("bus", strBus))
    1505             throw ConfigFileError(this, N_("Required HardDiskAttachment/@bus attribute is missing"));
     1513            throw ConfigFileError(this, pelmAttachment, N_("Required HardDiskAttachment/@bus attribute is missing"));
    15061514        // pre-1.7 'channel' is now port
    15071515        if (!pelmAttachment->getAttributeValue("channel", att.lPort))
    1508             throw ConfigFileError(this, N_("Required HardDiskAttachment/@channel attribute is missing"));
     1516            throw ConfigFileError(this, pelmAttachment, N_("Required HardDiskAttachment/@channel attribute is missing"));
    15091517        // pre-1.7 'device' is still device
    15101518        if (!pelmAttachment->getAttributeValue("device", att.lDevice))
    1511             throw ConfigFileError(this, N_("Required HardDiskAttachment/@device attribute is missing"));
     1519            throw ConfigFileError(this, pelmAttachment, N_("Required HardDiskAttachment/@device attribute is missing"));
    15121520
    15131521        if (strBus == "IDE")
    15141522        {
    15151523            if (!pIDEController)
    1516                 throw ConfigFileError(this, N_("HardDiskAttachment/@bus is 'IDE' but cannot find IDE controller"));
     1524                throw ConfigFileError(this, pelmAttachment, N_("HardDiskAttachment/@bus is 'IDE' but cannot find IDE controller"));
    15171525            pIDEController->llAttachedDevices.push_back(att);
    15181526        }
     
    15201528        {
    15211529            if (!pSATAController)
    1522                 throw ConfigFileError(this, N_("HardDiskAttachment/@bus is 'SATA' but cannot find SATA controller"));
     1530                throw ConfigFileError(this, pelmAttachment, N_("HardDiskAttachment/@bus is 'SATA' but cannot find SATA controller"));
    15231531            pSATAController->llAttachedDevices.push_back(att);
    15241532        }
    15251533        else
    1526             throw ConfigFileError(this, N_("HardDiskAttachment/@bus attribute has illegal value '%s'"), strBus.c_str());
     1534            throw ConfigFileError(this, pelmAttachment, N_("HardDiskAttachment/@bus attribute has illegal value '%s'"), strBus.c_str());
    15271535    }
    15281536}
     
    15481556
    15491557        if (!pelmController->getAttributeValue("name", sctl.strName))
    1550             throw ConfigFileError(this, N_("Required StorageController/@name attribute is missing"));
     1558            throw ConfigFileError(this, pelmController, N_("Required StorageController/@name attribute is missing"));
    15511559        Utf8Str strType;
    15521560        if (!pelmController->getAttributeValue("type", strType))
    1553             throw ConfigFileError(this, N_("Required StorageController/@type attribute is missing"));
     1561            throw ConfigFileError(this, pelmController, N_("Required StorageController/@type attribute is missing"));
    15541562
    15551563        if (strType == "AHCI")
     
    15841592        }
    15851593        else
    1586             throw ConfigFileError(this, N_("Invalid value '%s' for StorageController/@type attribute"), strType.c_str());
     1594            throw ConfigFileError(this, pelmController, N_("Invalid value '%s' for StorageController/@type attribute"), strType.c_str());
    15871595
    15881596        readStorageControllerAttributes(*pelmController, sctl);
     
    16011609                const xml::ElementNode *pelmImage;
    16021610                if (!(pelmImage = pelmAttached->findChildElement("Image")))
    1603                     throw ConfigFileError(this, N_("Required AttachedDevice/Image element is missing"));
     1611                    throw ConfigFileError(this, pelmImage, N_("Required AttachedDevice/Image element is missing"));
    16041612
    16051613                if (!pelmImage->getAttributeValue("uuid", strTemp))
    1606                     throw ConfigFileError(this, N_("Required AttachedDevice/Image/@uuid attribute is missing"));
     1614                    throw ConfigFileError(this, pelmImage, N_("Required AttachedDevice/Image/@uuid attribute is missing"));
    16071615                parseUUID(att.uuid, strTemp);
    16081616
    16091617                if (!pelmAttached->getAttributeValue("port", att.lPort))
    1610                     throw ConfigFileError(this, N_("Required AttachedDevice/@port attribute is missing"));
     1618                    throw ConfigFileError(this, pelmImage, N_("Required AttachedDevice/@port attribute is missing"));
    16111619                if (!pelmAttached->getAttributeValue("device", att.lDevice))
    1612                     throw ConfigFileError(this, N_("Required AttachedDevice/@device attribute is missing"));
     1620                    throw ConfigFileError(this, pelmImage, N_("Required AttachedDevice/@device attribute is missing"));
    16131621
    16141622                sctl.llAttachedDevices.push_back(att);
     
    16371645
    16381646    if (!elmSnapshot.getAttributeValue("uuid", strTemp))
    1639         throw ConfigFileError(this, N_("Required Snapshot/@uuid attribute is missing"));
     1647        throw ConfigFileError(this, &elmSnapshot, N_("Required Snapshot/@uuid attribute is missing"));
    16401648    parseUUID(snap.uuid, strTemp);
    16411649
    16421650    if (!elmSnapshot.getAttributeValue("name", snap.strName))
    1643         throw ConfigFileError(this, N_("Required Snapshot/@name attribute is missing"));
     1651        throw ConfigFileError(this, &elmSnapshot, N_("Required Snapshot/@name attribute is missing"));
    16441652
    16451653    elmSnapshot.getAttributeValue("Description", snap.strDescription);
    16461654
    16471655    if (!elmSnapshot.getAttributeValue("timeStamp", strTemp))
    1648         throw ConfigFileError(this, N_("Required Snapshot/@timeStamp attribute is missing"));
     1656        throw ConfigFileError(this, &elmSnapshot, N_("Required Snapshot/@timeStamp attribute is missing"));
    16491657    parseTimestamp(snap.timestamp, strTemp);
    16501658
     
    16541662    const xml::ElementNode *pelmHardware;
    16551663    if (!(pelmHardware = elmSnapshot.findChildElement("Hardware")))
    1656         throw ConfigFileError(this, N_("Required Snapshot/@Hardware element is missing"));
     1664        throw ConfigFileError(this, &elmSnapshot, N_("Required Snapshot/@Hardware element is missing"));
    16571665    readHardware(*pelmHardware, snap.hardware, snap.storage);
    16581666
     
    17211729        const xml::ElementNode *pelmHardware;
    17221730        if (!(pelmHardware = elmMachine.findChildElement("Hardware")))
    1723             throw ConfigFileError(this, N_("Required Machine/Hardware element is missing"));
     1731            throw ConfigFileError(this, &elmMachine, N_("Required Machine/Hardware element is missing"));
    17241732        readHardware(*pelmHardware, hardwareMachine, storageMachine);
    17251733
     
    17511759    }
    17521760    else
    1753         throw ConfigFileError(this, N_("Required Machine/@uuid or @name attributes is missing"));
     1761        throw ConfigFileError(this, &elmMachine, N_("Required Machine/@uuid or @name attributes is missing"));
    17541762}
    17551763
     
    17861794            if (pelmRootChild->nameEquals("Machine"))
    17871795                readMachine(*pelmRootChild);
    1788             else
    1789                 throw ConfigFileError(this, N_("Invalid element %s under root element"), pelmRootChild->getName());
    17901796        }
    17911797
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