Skip to content

Commit 6e07681

Browse files
author
Alexander Damian
committed
Added ActionTerminatedException to BackoffPerformer
1 parent 81a131f commit 6e07681

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

include/cppkafka/exceptions.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,14 @@ class CPPKAFKA_API QueueException : public Exception {
134134
Error error_;
135135
};
136136

137+
/**
138+
* Backoff performer has no more retries left for a specific action.
139+
*/
140+
class CPPKAFKA_API ActionTerminatedException : public Exception {
141+
public:
142+
ActionTerminatedException(const std::string& error);
143+
};
144+
137145
} // cppkafka
138146

139147
#endif // CPPKAFKA_EXCEPTIONS_H

include/cppkafka/utils/backoff_performer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ class CPPKAFKA_API BackoffPerformer {
136136
backoff = increase_backoff(backoff);
137137
}
138138
// No more retries left or we have a terminal error.
139-
throw Exception("Commit failed: no more retries.");
139+
throw ActionTerminatedException("Commit failed: no more retries.");
140140
}
141141
private:
142142
TimeUnit increase_backoff(TimeUnit backoff);

0 commit comments

Comments
 (0)