OSDN Git Service

Better exception handling for an error extracting natives from classpath.
authornathan.sweet <nathan.sweet@6c4fd544-2939-11df-bb46-9574ba5d0bfa>
Fri, 21 Jan 2011 09:04:00 +0000 (09:04 +0000)
committernathan.sweet <nathan.sweet@6c4fd544-2939-11df-bb46-9574ba5d0bfa>
Fri, 21 Jan 2011 09:04:00 +0000 (09:04 +0000)
gdx/src/com/badlogic/gdx/utils/GdxNativesLoader.java

index 30f0e11..24afb1d 100644 (file)
@@ -37,9 +37,9 @@ public class GdxNativesLoader {
        }\r
 \r
        static public String extractLibrary (String native32, String native64) {\r
+               String nativeFileName = is64Bit ? native64 : native32;\r
                try {\r
                        // Extract native from classpath to temp dir.\r
-                       String nativeFileName = is64Bit ? native64 : native32;\r
                        InputStream input = GdxNativesLoader.class.getResourceAsStream("/" + nativeFileName);\r
                        if (input == null) return null;\r
                        nativesDir.mkdirs();\r
@@ -55,7 +55,7 @@ public class GdxNativesLoader {
                        output.close();\r
                        return nativeFile.getAbsolutePath();\r
                } catch (IOException ex) {\r
-                       ex.printStackTrace();\r
+                       new GdxRuntimeException("Error extracting native library: " + nativeFileName, ex).printStackTrace();\r
                        return null;\r
                }\r
        }\r