Revert "Fixing issue where exception stack trace was getitng smashed."

This reverts commit 08f116fcaf.
This commit is contained in:
Paul Betts
2017-08-03 20:45:14 -07:00
parent 65f2c29343
commit 17666ded70

View File

@@ -68,7 +68,7 @@ namespace Squirrel.Bsdiff
t.Start();
t.Join();
if (ex != null) throw new Exception("Error creating binary patch", ex);
if (ex != null) throw ex;
}
static void CreateInternal(byte[] oldData, byte[] newData, Stream output)
@@ -229,18 +229,21 @@ namespace Squirrel.Bsdiff
long controlEndPosition = output.Position;
WriteInt64(controlEndPosition - startPosition - c_headerSize, header, 8);
// write compressed diff data
using (WrappingStream wrappingStream = new WrappingStream(output, Ownership.None))
using (var bz2Stream = new BZip2Stream(wrappingStream, CompressionMode.Compress))
{
// write compressed diff data
bz2Stream.Write(db, 0, dblen);
}
// compute size of compressed diff data
long diffEndPosition = output.Position;
WriteInt64(diffEndPosition - controlEndPosition, header, 16);
// compute size of compressed diff data
long diffEndPosition = output.Position;
WriteInt64(diffEndPosition - controlEndPosition, header, 16);
// write compressed extra data
// write compressed extra data
using (WrappingStream wrappingStream = new WrappingStream(output, Ownership.None))
using (var bz2Stream = new BZip2Stream(wrappingStream, CompressionMode.Compress))
{
bz2Stream.Write(eb, 0, eblen);
}