[COMMIT seastar master] sleep: derive sleep_aborted from abort_requested_exception

7 views
Skip to first unread message

Commit Bot

<bot@cloudius-systems.com>
unread,
Jun 21, 2022, 1:35:03 PM6/21/22
to seastar-dev@googlegroups.com, Benny Halevy
From: Benny Halevy <bha...@scylladb.com>
Committer: Benny Halevy <bha...@scylladb.com>
Branch: master

sleep: derive sleep_aborted from abort_requested_exception

sleep_aborted is generated when sleep_abortable is
aborted via an abort_source. Derive it from
the abort_requested_exception base class so that
users of the interface can catch the latter
for generic exception handling for this category of
exceptions.

Signed-off-by: Benny Halevy <bha...@scylladb.com>

---
diff --git a/include/seastar/core/sleep.hh b/include/seastar/core/sleep.hh
--- a/include/seastar/core/sleep.hh
+++ b/include/seastar/core/sleep.hh
@@ -56,7 +56,7 @@ future<> sleep(std::chrono::duration<Rep, Period> dur) {
}

/// exception that is thrown when application is in process of been stopped
-class sleep_aborted : public std::exception {
+class sleep_aborted : public abort_requested_exception {
public:
/// Reports the exception reason.
virtual const char* what() const noexcept {
Reply all
Reply to author
Forward
0 new messages