[FEATURE] Make WriteAheadLogCorruptionException more informative
dvakor opened this issue · comments
Is your feature request related to a problem? Please describe.
At this time WriteAheadLogCorruptionException has property Dictionary<int, Exception> Exceptions
, it is assumed that these are internal exceptions, but they are not rendering in any ways.
So it is a little bit hard to understand whats goes wrong.
Describe the solution you'd like
It would be nice that inner exception messages includes into main.
Describe alternatives you've considered
Provide aggregate exception to a base class. For example:
public class ImprovedWriteAheadLogCorruptionException : ZoneTreeException
{
public Dictionary<int, Exception> Exceptions { get; }
public ImprovedWriteAheadLogCorruptionException(long segmentId,
Dictionary<int, Exception> exceptions)
: base($"Write ahead log with segment id = {segmentId} is corrupted.", new AggregateException(exceptions.Values))
{
Exceptions = exceptions;
}
}
Thank you @dvakor !
Enhancement is included in v1.5.5.
https://github.com/koculu/ZoneTree/releases/tag/release-v1.5.5