Closed dmontagner closed 8 years ago
Sorry for the inconvenience. I've discovered the bug, fixed it, and am working on creating a new patch release asap.
@dmontagner v1.4.1 has just been published and it should resolve this issue.
@dmontagner You will still get a warning with the code you posted in this issue, however. It doesn't seem that u'...'
is a valid JavaScript string literal. So you will get a syntax error warning indicating an unexpected string.
If you remove all the u
prefixes from the strings in your code and run Pretty JSON/JSNONify JavsScript Object Literal and Sort and Prettify
, you should get the following output:
{
"DefaultBootOrder": [
"Floppy",
"Cd",
"Usb",
"EmbeddedStorage",
"PcieSlotStorage",
"EmbeddedFlexLOM",
"PcieSlotNic",
"UefiShell"
],
"Description": "This is the Server Boot Order Pending Settings",
"DesiredBootDevices": [
{
"CorrelatableID": "",
"Lun": "",
"Wwn": "",
"iScsiTargetName": ""
},
{
"CorrelatableID": "",
"Lun": "",
"Wwn": "",
"iScsiTargetName": ""
}
],
"Modified": "2016-06-03T01:38:44+00:00",
"Name": "Boot Order Pending Settings",
"PersistentBootConfigOrder": [
"HD.Emb.1.1",
"Generic.USB.1.1",
"NIC.LOM.1.1.IPv4",
"NIC.LOM.1.1.IPv4",
"NIC.LOM.1.1.IPv6",
"NIC.FlexLOM.1.1.IPv6",
"NIC.Slot.2.1.IPv4",
"NIC.Slot.3.1.IPv4",
"NIC.Slot.2.1.IPv6",
"NIC.Slot.3.1.IPv6"
],
"Type": "HpServerBootSettings.1.2.0",
"links": {
"self": {
"href": "/rest/v1/systems/1/bios/Boot/Settings"
}
}
}
Hi Amy,
So, whenever we enter an invalid string for this particular plugin, will we always get the warning/exception ?
Just wondering if instead we could get an error message saying the string is not valid for that particular plugin.
Thanks
Sent from my iPhone
On 4 Jun 2016, at 01:58, Amy Troschinetz notifications@github.com<mailto:notifications@github.com> wrote:
@dmontagnerhttps://github.com/dmontagner You will still get a warning with the code you posted in this issue, however. It doesn't seem that u'...' is a valid JavaScript string literalhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Grammar_and_types#String_literals. So you will get a syntax error warning indicating an unexpected string.
If you remove all the u prefixes from the strings in your code and run Pretty JSON/JSNONify JavsScript Object Literal and Sort and Prettify, you should get the following output:
{ "DefaultBootOrder": [ "Floppy", "Cd", "Usb", "EmbeddedStorage", "PcieSlotStorage", "EmbeddedFlexLOM", "PcieSlotNic", "UefiShell" ], "Description": "This is the Server Boot Order Pending Settings", "DesiredBootDevices": [ { "CorrelatableID": "", "Lun": "", "Wwn": "", "iScsiTargetName": "" }, { "CorrelatableID": "", "Lun": "", "Wwn": "", "iScsiTargetName": "" } ], "Modified": "2016-06-03T01:38:44+00:00", "Name": "Boot Order Pending Settings", "PersistentBootConfigOrder": [ "HD.Emb.1.1", "Generic.USB.1.1", "NIC.LOM.1.1.IPv4", "NIC.LOM.1.1.IPv4", "NIC.LOM.1.1.IPv6", "NIC.FlexLOM.1.1.IPv6", "NIC.Slot.2.1.IPv4", "NIC.Slot.3.1.IPv4", "NIC.Slot.2.1.IPv6", "NIC.Slot.3.1.IPv6" ], "Type": "HpServerBootSettings.1.2.0", "links": { "self": { "href": "/rest/v1/systems/1/bios/Boot/Settings" } } }
You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/federomero/pretty-json/issues/44#issuecomment-223619109, or mute the threadhttps://github.com/notifications/unsubscribe/AEtR2qyUxRsxdbvLUDX8PwKR5rf_-4E-ks5qIE88gaJpZM4ItKcS.
@dmontagner if there's a JSON parsing error or a JavaScript syntax error then pretty-json will try to be helpful by letting the user see that error message. Sadly the syntax errors for JavaScript are, imho, particularly bad.
[Enter steps to reproduce below:]
Atom Version: 1.7.4 System: Mac OS X 10.11.5 Thrown From: pretty-json package, v1.4.0
Stack Trace
Uncaught ReferenceError: packageName is not defined
Commands
Config
Installed Packages