瀏覽代碼

Catch Throwable rather than Exception.

NathanSweet 6 年之前
父節點
當前提交
750722f1c9

+ 2 - 2
spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SkeletonJson.java

@@ -268,7 +268,7 @@ public class SkeletonJson {
 					try {
 						Attachment attachment = readAttachment(entry, skin, slot.index, entry.name, skeletonData);
 						if (attachment != null) skin.addAttachment(slot.index, entry.name, attachment);
-					} catch (Exception ex) {
+					} catch (Throwable ex) {
 						throw new SerializationException("Error reading attachment: " + entry.name + ", skin: " + skin, ex);
 					}
 				}
@@ -307,7 +307,7 @@ public class SkeletonJson {
 		for (JsonValue animationMap = root.getChild("animations"); animationMap != null; animationMap = animationMap.next) {
 			try {
 				readAnimation(animationMap, animationMap.name, skeletonData);
-			} catch (Exception ex) {
+			} catch (Throwable ex) {
 				throw new SerializationException("Error reading animation: " + animationMap.name, ex);
 			}
 		}

+ 2 - 2
spine-libgdx/spine-skeletonviewer/src/com/esotericsoftware/spine/SkeletonViewer.java

@@ -200,7 +200,7 @@ public class SkeletonViewer extends ApplicationAdapter {
 				skeletonData = binary.readSkeletonData(skeletonFile);
 				if (skeletonData.getBones().size == 0) throw new Exception("No bones in skeleton data.");
 			}
-		} catch (Exception ex) {
+		} catch (Throwable ex) {
 			ex.printStackTrace();
 			ui.toast("Error loading skeleton: " + skeletonFile.name());
 			lastModifiedCheck = 5;
@@ -1033,7 +1033,7 @@ public class SkeletonViewer extends ApplicationAdapter {
 				loadScaleSlider.setValue(prefs.getFloat("scale", 1));
 				animationList.setSelected(prefs.getString("animationName", null));
 				skinList.setSelected(prefs.getString("skinName", null));
-			} catch (Exception ex) {
+			} catch (Throwable ex) {
 				System.out.println("Unable to read preferences:");
 				ex.printStackTrace();
 			}