Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Bettererrors #163

Merged
merged 2 commits into from

2 participants

@gregoryyoung

Some reads in the system are not really fatal issues as the information comes from a client

@jen20 jen20 merged commit f0e38e8 into from
@jen20 jen20 deleted the branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
View
18 src/EventStore.Core/TransactionLog/Chunks/TFChunk/TFChunkReadSide.cs
@@ -456,15 +456,15 @@ protected bool TryReadForwardInternal(ReaderWorkItem workItem, long actualPositi
length = workItem.Reader.ReadInt32();
if (length <= 0)
{
- throw new ArgumentException(
+ throw new InvalidReadException(
string.Format("Log record at actual pos {0} has non-positive length: {1}. "
- + "Something is seriously wrong in chunk {2}.", actualPosition, length, Chunk));
+ + " in chunk.", actualPosition, length, Chunk));
}
if (length > TFConsts.MaxLogRecordSize)
{
- throw new ArgumentException(
+ throw new InvalidReadException(
string.Format("Log record at actual pos {0} has too large length: {1} bytes, "
- + "while limit is {2} bytes. Something is seriously wrong in chunk {3}.",
+ + "while limit is {2} bytes. In chunk {3}.",
actualPosition, length, TFConsts.MaxLogRecordSize, Chunk));
}
if (actualPosition + length + 2 * sizeof(int) > Chunk.PhysicalDataSize)
@@ -504,16 +504,16 @@ protected bool TryReadBackwardInternal(ReaderWorkItem workItem, long actualPosit
length = workItem.Reader.ReadInt32();
if (length <= 0)
{
- throw new ArgumentException(
+ throw new InvalidReadException(
string.Format("Log record that ends at actual pos {0} has non-positive length: {1}. "
- + "Something is seriously wrong in chunk {2}.",
+ + "In chunk {2}.",
actualPosition, length, Chunk));
}
if (length > TFConsts.MaxLogRecordSize)
{
throw new ArgumentException(
string.Format("Log record that ends at actual pos {0} has too large length: {1} bytes, "
- + "while limit is {2} bytes. Something is seriously wrong in chunk {3}.",
+ + "while limit is {2} bytes. In chunk {3}.",
actualPosition, length, TFConsts.MaxLogRecordSize, Chunk));
}
if (actualPosition < length + 2 * sizeof(int)) // no space for record + length prefix and suffix
@@ -541,4 +541,8 @@ protected bool TryReadBackwardInternal(ReaderWorkItem workItem, long actualPosit
}
}
}
+
+ public class InvalidReadException : Exception {
+ public InvalidReadException(string message) : base(message) {}
+ }
}
Something went wrong with that request. Please try again.