Skip to content

Commit 98f55a6

Browse files
committed
checking if main works
1 parent a7ac607 commit 98f55a6

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

src/project_x_py/client/auth.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ async def authenticate(self) -> None:
179179
response = await self._make_request("POST", "/Auth/loginKey", data=auth_data)
180180

181181
if not response:
182+
logger.error(f"Empty response from auth endpoint")
182183
raise ProjectXAuthenticationError(ErrorMessages.AUTH_FAILED)
183184

184185
self.session_token = response["token"]

src/project_x_py/client/http.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,9 @@ async def _make_request(
280280
retry_count=retry_count + 1,
281281
)
282282
return retry_result
283+
logger.error(
284+
f"Authentication failed for {endpoint}, status: {response.status_code}, response: {response.text[:200]}"
285+
)
283286
raise ProjectXAuthenticationError(ErrorMessages.AUTH_FAILED)
284287

285288
# Handle client errors
@@ -294,6 +297,15 @@ async def _make_request(
294297
except Exception:
295298
error_msg = response.text
296299

300+
# Log authentication endpoint errors for debugging
301+
if endpoint == "/Auth/loginKey":
302+
logger.error(
303+
f"Auth endpoint error - Status: {response.status_code}, Message: {error_msg}"
304+
)
305+
return (
306+
None # Return None for auth failures to match expected behavior
307+
)
308+
297309
if response.status_code == 404:
298310
raise ProjectXDataError(
299311
format_error_message(

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)