Kod: Zaznacz cały
public static int getIntegerNodeAttribute(Node node, String attributeName) {
if (node.getAttribute(attributeName) == null) {
throw new RuntimeException("Attribute, " + attributeName
+ ", missing from node");
}
return (Integer) node.getAttribute(attributeName);
}
Kod: Zaznacz cały
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException("FUBAR!", e);
}
Kod: Zaznacz cały
catch (RuntimeException e2) {
textArea.setText("Attribute missing from node");
}
catch (Exception e1) {
textArea.setText("Could not generate!");
}
Czyli wyjątek z klasy X nie jest dalej przekazywany, skoro blok catch w gui go nie wychwytuje. Czemu?java.lang.RuntimeException: Attribute, location_80%HPD_modality, missing from node