Skip to content

Commit

Permalink
Better str for BulkDeleteError
Browse files Browse the repository at this point in the history
  • Loading branch information
davfsa committed Dec 8, 2020
1 parent 7239bca commit 5a95ea2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions hikari/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -579,6 +579,11 @@ def percentage_completion(self) -> float:
total = deleted + len(self.messages_skipped)
return 100 * deleted / total

def __str__(self) -> str:
deleted = len(self.messages_deleted)
total = deleted + len(self.messages_skipped)
return f"Error encountered when bulk deleting messages ({deleted}/{total} messages deleted)"


@attr.s(auto_exc=True, slots=True, repr=False, init=False, weakref_slot=False)
class VoiceError(HikariError):
Expand Down

0 comments on commit 5a95ea2

Please sign in to comment.