Improve error tolerance of new meteorite code, and record errors to log.
This commit is contained in:
+25
-4
@@ -83,14 +83,26 @@ public class WorldSettings extends Configuration
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
fis = new FileInputStream( f );
|
fis = new FileInputStream( f );
|
||||||
NBTTagCompound data = CompressedStreamTools.readCompressed( fis );
|
|
||||||
|
NBTTagCompound data = null;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
data = CompressedStreamTools.readCompressed( fis );
|
||||||
|
}
|
||||||
|
catch (Throwable e)
|
||||||
|
{
|
||||||
|
data = new NBTTagCompound();
|
||||||
|
AELog.error( e );
|
||||||
|
}
|
||||||
|
|
||||||
fis.close();
|
fis.close();
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
catch (Throwable e)
|
catch (Throwable e)
|
||||||
{
|
{
|
||||||
|
AELog.error( e );
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -109,12 +121,21 @@ public class WorldSettings extends Configuration
|
|||||||
{
|
{
|
||||||
// save
|
// save
|
||||||
FileOutputStream fos = new FileOutputStream( f );
|
FileOutputStream fos = new FileOutputStream( f );
|
||||||
CompressedStreamTools.writeCompressed( data, fos );
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
CompressedStreamTools.writeCompressed( data, fos );
|
||||||
|
}
|
||||||
|
catch( Throwable e )
|
||||||
|
{
|
||||||
|
AELog.error( e );
|
||||||
|
}
|
||||||
|
|
||||||
fos.close();
|
fos.close();
|
||||||
}
|
}
|
||||||
catch (Throwable e)
|
catch (Throwable e)
|
||||||
{
|
{
|
||||||
|
AELog.error( e );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user