From b3a949fe43a46603f35b4364b55c7354929ce156 Mon Sep 17 00:00:00 2001 From: Downforce Agent Date: Fri, 2 Aug 2024 17:00:29 -0500 Subject: [PATCH] better error dialog --- firestar/src/main/java/Rizzo.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/firestar/src/main/java/Rizzo.java b/firestar/src/main/java/Rizzo.java index 31637bd..b7c7e11 100644 --- a/firestar/src/main/java/Rizzo.java +++ b/firestar/src/main/java/Rizzo.java @@ -89,7 +89,7 @@ public class Rizzo { File newCtx = new File(workingDir + args[1]); System.out.println("Calling new parse: " + Arrays.toString(Arrays.copyOfRange(args, 2, args.length))); parseArgs(Arrays.copyOfRange(args, 2, args.length), newCtx); - } else throw new FirescriptFormatException("fscript", "unknown command '" + args[0] + "'"); + } else throw new FirescriptFormatException("fscript", "command '" + args[0] + "' is unknown or used in inappropriate context\n\nOne of your mods has a broken FSCRIPT. It cannot be installed."); } else { System.out.println("Parsing Command: " + Arrays.toString(args) + " using context: " + context.getClass().getName() + "@" + context.hashCode()); if (args[0].equals("{")) { @@ -132,7 +132,7 @@ public class Rizzo { Logger.getLogger(Rizzo.class.getName()).log(Level.SEVERE, null, ex); } } catch (SAXException | IOException | ParserConfigurationException ex) { - Logger.getLogger(Rizzo.class.getName()).log(Level.SEVERE, null, ex); + Logger.getLogger(Rizzo.class.getName()).log(Level.SEVERE, "This usually means there's non-standard formatting from the game developer which your FSCRIPT does not account for.", ex); } } else if (args[0].equalsIgnoreCase("str") || args[0].equalsIgnoreCase("xstr")) { try { @@ -199,7 +199,7 @@ public class Rizzo { } catch (FirescriptFormatException | PatchFailedException | IOException ex) { Logger.getLogger(Rizzo.class.getName()).log(Level.SEVERE, null, ex); } - } else throw new FirescriptFormatException("file", "unknown command '" + args[0] + "'"); + } else throw new FirescriptFormatException("file", "command '" + args[0] + "' is unknown or used in inappropriate context\n\nOne of your mods has a broken FSCRIPT. It cannot be installed."); } else if (args[0].equalsIgnoreCase("xml")) { System.out.println("fscript: XML called but file does not exist. Using placebo..."); try { @@ -234,7 +234,7 @@ public class Rizzo { try { DocumentBuilder docBuilder = docFactory.newDocumentBuilder(); ReplacingInputStream ris = new ReplacingInputStream(new ReplacingInputStream(new ReplacingInputStream(new FileInputStream(new File(workingDir + args[1])), "\r\n", ""), "&", "&"), "\n", " "); - Document outDoc = docBuilder.parse(ris); + Document outDoc = docBuilder.parse(ris); // throw new FirescriptFormatException("xml", "javax.xml.parsers self-destructed with error:\n" + e.getMessage() + "\nThis usually means you used a bad FSCRIPT, or there was non-standard formatting from the game developer."); NamedNodeMap nnm = outDoc.getDocumentElement().getAttributes(); for (int x = 0; x < nnm.getLength(); x++) { @@ -248,9 +248,9 @@ public class Rizzo { document.getDocumentElement().appendChild(importedNode); } } catch (SAXException | IOException | ParserConfigurationException ex) { - Logger.getLogger(Rizzo.class.getName()).log(Level.SEVERE, null, ex); + Logger.getLogger(Rizzo.class.getName()).log(Level.SEVERE, "This usually means there's non-standard formatting from the game developer which your FSCRIPT does not account for.", ex); } - } else throw new FirescriptFormatException("xml", "unknown command '" + args[0] + "'"); + } else throw new FirescriptFormatException("xml", "command '" + args[0] + "' is unknown or used in inappropriate context\n\nOne of your mods has a broken FSCRIPT. It cannot be installed."); } else { System.out.println("fscript: XML document has no child nodes. Skipping..."); parseArgs(Arrays.copyOfRange(args, 1, args.length), document);