C# Client Library
A C# Client Library for the AnalyzeRe REST API
BufferProducerException.cs
Go to the documentation of this file.
1 using System;
2 
3 namespace AnalyzeRe.LargeDataUpload
4 {
7  [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage",
8  "CA2237:MarkISerializableTypesWithSerializable")]
9  public class BufferProducerException : Exception
10  {
13  public int Depth { get; }
14 
16  public Exception OriginalException { get; }
17 
19  public BufferProducerException(Exception innerException)
20  : base(GetMessage(innerException), innerException)
21  {
22  BufferProducerException asBpException = innerException as BufferProducerException;
23  Depth = 1 + asBpException?.Depth ?? 0;
24  OriginalException = asBpException?.OriginalException ?? innerException;
25  }
26 
27  private static string GetMessage(Exception ex)
28  {
30  int depth = 1 + asBpException?.Depth ?? 0;
31  Exception originalException = asBpException?.OriginalException ?? ex;
32 
33  return "An exception occurred on the producer thread at depth " +
34  depth + ": " + originalException.Message;
35  }
36  }
37 }
BufferProducerException(Exception innerException)
Indicates that an exception occurred inside of a buffered producer thread.
int Depth
The Depth of the original exception, in the case of a chain of buffered producer consumers.
Indicates that an exception occurred inside of a buffered producer thread.
Exception OriginalException
The innermost exception that led to the first BufferProducerException.