Added ActionTerminatedException to BackoffPerformer

This commit is contained in:
Alexander Damian
2019-04-26 11:12:52 -04:00
parent 81a131ff16
commit 6e076810a0
2 changed files with 9 additions and 1 deletions

View File

@@ -134,6 +134,14 @@ private:
Error error_; Error error_;
}; };
/**
* Backoff performer has no more retries left for a specific action.
*/
class CPPKAFKA_API ActionTerminatedException : public Exception {
public:
ActionTerminatedException(const std::string& error);
};
} // cppkafka } // cppkafka
#endif // CPPKAFKA_EXCEPTIONS_H #endif // CPPKAFKA_EXCEPTIONS_H

View File

@@ -136,7 +136,7 @@ public:
backoff = increase_backoff(backoff); backoff = increase_backoff(backoff);
} }
// No more retries left or we have a terminal error. // No more retries left or we have a terminal error.
throw Exception("Commit failed: no more retries."); throw ActionTerminatedException("Commit failed: no more retries.");
} }
private: private:
TimeUnit increase_backoff(TimeUnit backoff); TimeUnit increase_backoff(TimeUnit backoff);