mirror of
https://github.com/Telecominfraproject/wlan-cloud-lib-cppkafka.git
synced 2025-11-18 18:54:50 +00:00
Added ActionTerminatedException to BackoffPerformer
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user