From 2905c07863ab7ebc237707dd8eeee3c3ebd46999 Mon Sep 17 00:00:00 2001 From: alex martin shepherd <110127860+alexmshepherd@users.noreply.github.com> Date: Fri, 3 Mar 2023 12:47:43 +0100 Subject: [PATCH] Add custom exception --- mastodon/statuses.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mastodon/statuses.py b/mastodon/statuses.py index 7368961..d2c8628 100644 --- a/mastodon/statuses.py +++ b/mastodon/statuses.py @@ -341,7 +341,10 @@ class Mastodon(Internals): # Determine users to mention mentioned_accounts = collections.OrderedDict() - mentioned_accounts[to_status.account.id] = to_status.account.acct + try: + mentioned_accounts[to_status.account.id] = to_status.account.acct + except AttributeError as e: + raise TypeError("to_status must specify a status dict!") from e if not untag: for account in to_status.mentions: