Changeset 22302 in vbox for trunk/src/VBox/Main
- Timestamp:
- Aug 17, 2009 3:36:01 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/xml/Settings.cpp
r22301 r22302 85 85 { 86 86 public: 87 ConfigFileError(const ConfigFileBase *file, const char *pcszFormat, ...) 87 ConfigFileError(const ConfigFileBase *file, 88 const xml::Node *pNode, 89 const char *pcszFormat, ...) 88 90 : xml::LogicError() 89 91 { … … 93 95 va_end(args); 94 96 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()); 96 105 97 106 setWhat(str.c_str()); … … 121 130 m->pelmRoot = m->pDoc->getRootElement(); 122 131 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\".")); 124 133 125 134 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")); 127 136 128 137 m->sv = SettingsVersion_Null; … … 145 154 146 155 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()); 148 157 } 149 158 else … … 188 197 189 198 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()); 191 200 } 192 201 … … 211 220 && (pcsz[19] != 'Z') 212 221 ) 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()); 214 223 215 224 int32_t yyyy; … … 248 257 } 249 258 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()); 254 263 } 255 264 } … … 264 273 RTTIME time; 265 274 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)); 267 276 268 277 return Utf8StrFmt("%04ld-%02hd-%02hdT%02hd:%02hd:%02hdZ", … … 311 320 map[strName] = strValue; 312 321 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 } 317 324 } 318 325 } … … 360 367 flt.action = USBDeviceFilterAction_Hold; 361 368 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()); 363 370 } 364 371 … … 535 542 } 536 543 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")); 538 545 } 539 546 } … … 563 570 { 564 571 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")); 566 573 567 574 if (!(elmMedium.getAttributeValue("autoReset", med.fAutoReset))) … … 578 585 med.hdType = HardDiskType_Writethrough; 579 586 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")); 581 588 } 582 589 } … … 602 609 med.properties[strPropName] = strPropValue; 603 610 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")); 605 612 } 606 613 } … … 609 616 } 610 617 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()); 612 619 } 613 620 … … 680 687 llDhcpServers.push_back(srv); 681 688 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")); 683 690 } 684 691 } … … 969 976 970 977 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")); 972 979 973 980 Utf8Str strTemp; … … 985 992 nic.type = NetworkAdapterType_I82545EM; 986 993 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()); 988 995 } 989 996 … … 1012 1019 nic.mode = NetworkAttachmentType_Internal; 1013 1020 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")); 1015 1022 } 1016 1023 else if ((pelmAdapterChild = pelmAdapter->findChildElement("HostOnlyInterface"))) … … 1018 1025 nic.mode = NetworkAttachmentType_HostOnly; 1019 1026 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")); 1021 1028 } 1022 1029 // else: default is NetworkAttachmentType_Null … … 1040 1047 SerialPort port; 1041 1048 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")); 1043 1050 1044 1051 // slot must be unique … … 1047 1054 ++it) 1048 1055 if ((*it).ulSlot == port.ulSlot) 1049 throw ConfigFileError(this, N_("UART/Port/@slot attribute value %d is used twice, must beunique"), port.ulSlot);1056 throw ConfigFileError(this, pelmPort, N_("Invalid value %RU32 in UART/Port/@slot attribute: value is not unique"), port.ulSlot); 1050 1057 1051 1058 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")); 1053 1060 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")); 1055 1062 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")); 1057 1064 1058 1065 Utf8Str strPortMode; 1059 1066 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")); 1061 1068 if (strPortMode == "RawFile") 1062 1069 port.portMode = PortMode_RawFile; … … 1068 1075 port.portMode = PortMode_Disconnected; 1069 1076 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()); 1071 1078 1072 1079 pelmPort->getAttributeValue("path", port.strPath); … … 1091 1098 ParallelPort port; 1092 1099 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")); 1094 1101 1095 1102 // slot must be unique … … 1098 1105 ++it) 1099 1106 if ((*it).ulSlot == port.ulSlot) 1100 throw ConfigFileError(this, N_("LPT/Port/@slot attribute value %d is used twice, must beunique"), port.ulSlot);1107 throw ConfigFileError(this, pelmPort, N_("Invalid value %RU32 in LPT/Port/@slot attribute: value is not unique"), port.ulSlot); 1101 1108 1102 1109 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")); 1104 1111 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")); 1106 1113 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")); 1108 1115 1109 1116 pelmPort->getAttributeValue("path", port.strPath); … … 1202 1209 Utf8Str strDevice; 1203 1210 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")); 1205 1212 1206 1213 if ( ulPos < 1 … … 1208 1215 ) 1209 1216 throw ConfigFileError(this, 1217 pelmOrder, 1210 1218 N_("Invalid value '%RU32' in Boot/Order/@position: must be greater than 0 and less than %RU32"), 1211 1219 ulPos, … … 1215 1223 1216 1224 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); 1218 1226 1219 1227 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")); 1221 1229 1222 1230 DeviceType_T type; … … 1232 1240 type = DeviceType_Network; 1233 1241 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()); 1235 1243 hw.mapBootOrder[ulPos] = type; 1236 1244 } … … 1259 1267 hw.vrdpSettings.authType = VRDPAuthType_External; 1260 1268 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()); 1262 1270 } 1263 1271 … … 1292 1300 hw.biosSettings.biosBootMenuMode = BIOSBootMenuMode_MessageAndMenu; 1293 1301 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()); 1295 1303 } 1296 1304 } … … 1319 1327 sctl.controllerType = StorageControllerType_ICH6; 1320 1328 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()); 1322 1330 } 1323 1331 sctl.ulPortCount = 2; … … 1394 1402 hw.audioAdapter.controllerType = AudioControllerType_AC97; 1395 1403 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()); 1397 1405 } 1398 1406 if (pelmHwChild->getAttributeValue("driver", strTemp)) … … 1417 1425 hw.audioAdapter.driverType = AudioDriverType_MMPM; 1418 1426 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()); 1420 1428 } 1421 1429 } … … 1447 1455 hw.clipboardMode = ClipboardMode_Bidirectional; 1448 1456 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()); 1450 1458 } 1451 1459 } … … 1458 1466 readGuestProperties(*pelmHwChild, hw); 1459 1467 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()); 1461 1469 } 1462 1470 1463 1471 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")); 1465 1473 } 1466 1474 … … 1499 1507 1500 1508 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")); 1502 1510 parseUUID(att.uuid, strUUID); 1503 1511 1504 1512 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")); 1506 1514 // pre-1.7 'channel' is now port 1507 1515 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")); 1509 1517 // pre-1.7 'device' is still device 1510 1518 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")); 1512 1520 1513 1521 if (strBus == "IDE") 1514 1522 { 1515 1523 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")); 1517 1525 pIDEController->llAttachedDevices.push_back(att); 1518 1526 } … … 1520 1528 { 1521 1529 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")); 1523 1531 pSATAController->llAttachedDevices.push_back(att); 1524 1532 } 1525 1533 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()); 1527 1535 } 1528 1536 } … … 1548 1556 1549 1557 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")); 1551 1559 Utf8Str strType; 1552 1560 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")); 1554 1562 1555 1563 if (strType == "AHCI") … … 1584 1592 } 1585 1593 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()); 1587 1595 1588 1596 readStorageControllerAttributes(*pelmController, sctl); … … 1601 1609 const xml::ElementNode *pelmImage; 1602 1610 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")); 1604 1612 1605 1613 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")); 1607 1615 parseUUID(att.uuid, strTemp); 1608 1616 1609 1617 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")); 1611 1619 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")); 1613 1621 1614 1622 sctl.llAttachedDevices.push_back(att); … … 1637 1645 1638 1646 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")); 1640 1648 parseUUID(snap.uuid, strTemp); 1641 1649 1642 1650 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")); 1644 1652 1645 1653 elmSnapshot.getAttributeValue("Description", snap.strDescription); 1646 1654 1647 1655 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")); 1649 1657 parseTimestamp(snap.timestamp, strTemp); 1650 1658 … … 1654 1662 const xml::ElementNode *pelmHardware; 1655 1663 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")); 1657 1665 readHardware(*pelmHardware, snap.hardware, snap.storage); 1658 1666 … … 1721 1729 const xml::ElementNode *pelmHardware; 1722 1730 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")); 1724 1732 readHardware(*pelmHardware, hardwareMachine, storageMachine); 1725 1733 … … 1751 1759 } 1752 1760 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")); 1754 1762 } 1755 1763 … … 1786 1794 if (pelmRootChild->nameEquals("Machine")) 1787 1795 readMachine(*pelmRootChild); 1788 else1789 throw ConfigFileError(this, N_("Invalid element %s under root element"), pelmRootChild->getName());1790 1796 } 1791 1797
Note:
See TracChangeset
for help on using the changeset viewer.