File tree Expand file tree Collapse file tree 2 files changed +15
-3
lines changed
Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
44
55[tool .poetry ]
66name = " twitter-plugin-gamesdk"
7- version = " 0.2.10 "
7+ version = " 0.2.11 "
88description = " Twitter Plugin for Python SDK for GAME by Virtuals"
99authors = [" Celeste Ang <celeste@virtuals.io>" ]
1010readme = " README.md"
Original file line number Diff line number Diff line change @@ -68,8 +68,20 @@ def get_login_url(api_key: str) -> str:
6868 Fetches the login URL from the authentication server.
6969 """
7070 response = requests .get (f"{ BASE_URL } /auth" , headers = {"x-api-key" : api_key })
71- response .raise_for_status ()
72- return response .json ().get ("url" )
71+
72+ if response .status_code != 200 :
73+ try :
74+ error_info = response .json ()
75+ message = error_info .get ("message" , "Unknown error" )
76+ status = error_info .get ("statusCode" , response .status_code )
77+
78+ print (f"Auth Error: { message } (Status: { status } )" )
79+ except Exception :
80+ print (f"Failed to parse error. Raw response:\n { response .text } " )
81+ message = response .text
82+ raise Exception (f"Auth request failed: { message } " )
83+ else :
84+ return response .json ().get ("url" )
7385
7486 @staticmethod
7587 def verify_auth (code : str , state : str ) -> str :
You can’t perform that action at this time.
0 commit comments