File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed
Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change 1010 TransformerError ,
1111)
1212
13- from ghutils . core . types import NotLoggedInError
13+ from . types import NotLoggedInError , SilentError
1414
1515
1616class GHUtilsCommandTree (CommandTree ):
1717 async def on_error (self , interaction : Interaction , error : AppCommandError ):
18+ if isinstance (error , SilentError ):
19+ return
20+
1821 if interaction .response .is_done ():
1922 await super ().on_error (interaction , error )
2023 return
Original file line number Diff line number Diff line change @@ -9,5 +9,14 @@ class LoginState(Enum):
99 EXPIRED = auto ()
1010
1111
12+ # TODO: add Literal[LoginState.LOGGED_OUT, LoginState.EXPIRED] parameter
1213class NotLoggedInError (AppCommandError ):
13- pass
14+ """An exception raised when the command user is not logged in to GitHub.
15+
16+ Commands that require the user of the command to log in with GitHub can throw this
17+ if the user is not logged in to reply with a standard error message.
18+ """
19+
20+
21+ class SilentError (AppCommandError ):
22+ """Base class for exceptions that should be silently caught and ignored."""
You can’t perform that action at this time.
0 commit comments