From 6961bb1b72b442d16c2c51425808b5f7d9f56b95 Mon Sep 17 00:00:00 2001 From: Vladimir Bryzgalov Date: Fri, 17 Apr 2026 22:39:04 +0500 Subject: [PATCH] feat(telegram): exception carrying permanent/retry_after flags --- includes/class-telegram-exception.php | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 includes/class-telegram-exception.php diff --git a/includes/class-telegram-exception.php b/includes/class-telegram-exception.php new file mode 100644 index 0000000..076590e --- /dev/null +++ b/includes/class-telegram-exception.php @@ -0,0 +1,27 @@ +permanent = $permanent; + $this->retry_after = max(0, $retry_after); + } + + public function is_permanent(): bool + { + return $this->permanent; + } + + public function retry_after(): int + { + return $this->retry_after; + } +}