Improve error tolerance of new meteorite code, and record errors to log.
This commit is contained in:
parent
189c86581a
commit
fd162625ee
1 changed files with 26 additions and 5 deletions
|
@ -83,14 +83,26 @@ public class WorldSettings extends Configuration
|
|||
try
|
||||
{
|
||||
fis = new FileInputStream( f );
|
||||
NBTTagCompound data = CompressedStreamTools.readCompressed( fis );
|
||||
fis.close();
|
||||
|
||||
NBTTagCompound data = null;
|
||||
|
||||
try
|
||||
{
|
||||
data = CompressedStreamTools.readCompressed( fis );
|
||||
}
|
||||
catch (Throwable e)
|
||||
{
|
||||
data = new NBTTagCompound();
|
||||
AELog.error( e );
|
||||
}
|
||||
|
||||
fis.close();
|
||||
|
||||
return data;
|
||||
}
|
||||
catch (Throwable e)
|
||||
{
|
||||
|
||||
AELog.error( e );
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -109,12 +121,21 @@ public class WorldSettings extends Configuration
|
|||
{
|
||||
// save
|
||||
FileOutputStream fos = new FileOutputStream( f );
|
||||
CompressedStreamTools.writeCompressed( data, fos );
|
||||
|
||||
try
|
||||
{
|
||||
CompressedStreamTools.writeCompressed( data, fos );
|
||||
}
|
||||
catch( Throwable e )
|
||||
{
|
||||
AELog.error( e );
|
||||
}
|
||||
|
||||
fos.close();
|
||||
}
|
||||
catch (Throwable e)
|
||||
{
|
||||
|
||||
AELog.error( e );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue