Skip to content

Commit c6eceef

Browse files
authored
partital error exception types (#779)
1 parent 2535953 commit c6eceef

File tree

7 files changed

+21
-21
lines changed

7 files changed

+21
-21
lines changed

src/Confluent.Kafka/Admin/AlterConfigsException.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ namespace Confluent.Kafka.Admin
2424
/// <summary>
2525
/// Represents an error that occured during an alter configs request.
2626
/// </summary>
27-
public class AlterConfigsException : Exception
27+
public class AlterConfigsException : KafkaException
2828
{
2929
/// <summary>
3030
/// Initializes a new instance of AlterConfigsException.
@@ -35,11 +35,11 @@ public class AlterConfigsException : Exception
3535
/// results will be in error.
3636
/// </param>
3737
public AlterConfigsException(List<AlterConfigsReport> results)
38-
: base(
38+
: base(new Error(ErrorCode.Local_Partial,
3939
"An error occurred altering the following resources: [" +
4040
String.Join(", ", results.Where(r => r.Error.IsError).Select(r => r.ConfigResource)) +
4141
"]: [" + String.Join(", ", results.Where(r => r.Error.IsError).Select(r => r.Error)) +
42-
"].")
42+
"]."))
4343
{
4444
Results = results;
4545
}

src/Confluent.Kafka/Admin/CreatePartitionsException.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ namespace Confluent.Kafka.Admin
2424
/// <summary>
2525
/// Represents an error that occured during a create partitions request.
2626
/// </summary>
27-
public class CreatePartitionsException : Exception
27+
public class CreatePartitionsException : KafkaException
2828
{
2929
/// <summary>
3030
/// Initialize a new instance of CreatePartitionsException.
@@ -35,11 +35,11 @@ public class CreatePartitionsException : Exception
3535
/// results will be in error.
3636
/// </param>
3737
public CreatePartitionsException(List<CreatePartitionsReport> results)
38-
: base(
38+
: base(new Error(ErrorCode.Local_Partial,
3939
"An error occurred creating partitions for topics: [" +
4040
String.Join(", ", results.Where(r => r.Error.IsError).Select(r => r.Topic)) +
4141
"]: [" + String.Join(", ", results.Where(r => r.Error.IsError).Select(r => r.Error)) +
42-
"].")
42+
"]."))
4343
{
4444
Results = results;
4545
}

src/Confluent.Kafka/Admin/CreateTopicsException.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ namespace Confluent.Kafka.Admin
2424
/// <summary>
2525
/// Represents an error that occured during a create topics request.
2626
/// </summary>
27-
public class CreateTopicsException : Exception
27+
public class CreateTopicsException : KafkaException
2828
{
2929
/// <summary>
3030
/// Initialize a new instance of CreateTopicsException.
@@ -35,11 +35,11 @@ public class CreateTopicsException : Exception
3535
/// results will be in error.
3636
/// </param>
3737
public CreateTopicsException(List<CreateTopicReport> results)
38-
: base(
38+
: base(new Error(ErrorCode.Local_Partial,
3939
"An error occurred creating topics: [" +
4040
String.Join(", ", results.Where(r => r.Error.IsError).Select(r => r.Topic)) +
4141
"]: [" + String.Join(", ", results.Where(r => r.Error.IsError).Select(r => r.Error)) +
42-
"].")
42+
"]."))
4343
{
4444
this.Results = results;
4545
}

src/Confluent.Kafka/Admin/DeleteTopicsException.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ namespace Confluent.Kafka.Admin
2424
/// <summary>
2525
/// Represents an error that occured during a delete topics request.
2626
/// </summary>
27-
public class DeleteTopicsException : Exception
27+
public class DeleteTopicsException : KafkaException
2828
{
2929
/// <summary>
3030
/// Initializes a new DeleteTopicsException.
@@ -35,11 +35,11 @@ public class DeleteTopicsException : Exception
3535
/// results will be in error.
3636
/// </param>
3737
public DeleteTopicsException(List<DeleteTopicReport> results)
38-
: base(
38+
: base(new Error(ErrorCode.Local_Partial,
3939
"An error occurred deleting topics: [" +
4040
String.Join(", ", results.Where(r => r.Error.IsError).Select(r => r.Topic)) +
4141
"]: [" + String.Join(", ", results.Where(r => r.Error.IsError).Select(r => r.Error)) +
42-
"].")
42+
"]."))
4343
{
4444
Results = results;
4545
}

src/Confluent.Kafka/Admin/DescribeConfigsException.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ namespace Confluent.Kafka.Admin
2424
/// <summary>
2525
/// Represents an error that occured during a describe configs request.
2626
/// </summary>
27-
public class DescribeConfigsException : Exception
27+
public class DescribeConfigsException : KafkaException
2828
{
2929
/// <summary>
3030
/// Initializes a new instance of DescribeConfigsException.
@@ -35,11 +35,11 @@ public class DescribeConfigsException : Exception
3535
/// results will be in error.
3636
/// </param>
3737
public DescribeConfigsException(List<DescribeConfigsReport> results)
38-
: base(
38+
: base(new Error(ErrorCode.Local_Partial,
3939
"An error occurred describing the following resources: [" +
4040
String.Join(", ", results.Where(r => r.Error.IsError).Select(r => r.ConfigResource)) +
4141
"]: [" + String.Join(", ", results.Where(r => r.Error.IsError).Select(r => r.Error)) +
42-
"].")
42+
"]."))
4343
{
4444
Results = results;
4545
}

src/Confluent.Kafka/Exceptions/TopicPartitionException.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ namespace Confluent.Kafka
2424
/// <summary>
2525
/// Represents an error that occured during a Consumer.Position request.
2626
/// </summary>
27-
public class TopicPartitionException : Exception
27+
public class TopicPartitionException : KafkaException
2828
{
2929
/// <summary>
3030
/// Initializes a new instance of OffsetsRequestExceptoion.
@@ -35,10 +35,10 @@ public class TopicPartitionException : Exception
3535
/// results will be in error.
3636
/// </param>
3737
public TopicPartitionException(List<TopicPartitionError> results)
38-
: base(
38+
: base(new Error(ErrorCode.Local_Partial,
3939
"An error occurred for topic partitions: [" +
4040
String.Join(", ", results.Where(r => r.Error.IsError).Select(r => r.TopicPartition)) +
41-
"].")
41+
"]."))
4242
{
4343
Results = results;
4444
}

src/Confluent.Kafka/Exceptions/TopicPartitionOffsetException.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ namespace Confluent.Kafka
2424
/// <summary>
2525
/// Represents an error that occured during a Consumer.Position request.
2626
/// </summary>
27-
public class TopicPartitionOffsetException : Exception
27+
public class TopicPartitionOffsetException : KafkaException
2828
{
2929
/// <summary>
3030
/// Initializes a new instance of OffsetsRequestExceptoion.
@@ -35,10 +35,10 @@ public class TopicPartitionOffsetException : Exception
3535
/// results will be in error.
3636
/// </param>
3737
public TopicPartitionOffsetException(List<TopicPartitionOffsetError> results)
38-
: base(
38+
: base(new Error(ErrorCode.Local_Partial,
3939
"An error occurred retrieving offsets for: [" +
4040
String.Join(", ", results.Where(r => r.Error.IsError).Select(r => r.TopicPartition)) +
41-
"].")
41+
"]."))
4242
{
4343
Results = results;
4444
}

0 commit comments

Comments
 (0)