mirror of
https://github.com/arcan1s/ahriman.git
synced 2026-10-13 16:42:16 +00:00
feat: raise OptionError on missing OAuth provider class instead of generic AttributeError
This commit is contained in:
1 parent
d7cee68cb7
commit
c924699163
1 file changed
+1
-1
@@ -86,7 +86,7 @@ class OAuth(Mapping):
|
|||||||
Raises:
|
Raises:
|
||||||
OptionError: in case if invalid OAuth provider name supplied
|
OptionError: in case if invalid OAuth provider name supplied
|
||||||
"""
|
"""
|
||||||
provider: type[aioauth_client.OAuth2Client] = getattr(aioauth_client, name)
|
provider: type = getattr(aioauth_client, name, type(None))
|
||||||
try:
|
try:
|
||||||
is_oauth2_client = issubclass(provider, aioauth_client.OAuth2Client)
|
is_oauth2_client = issubclass(provider, aioauth_client.OAuth2Client)
|
||||||
except TypeError: # what if it is random string?
|
except TypeError: # what if it is random string?
|
||||||
|
|||||||
Reference in new issue
Block a user