Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bases/rsptx/admin_server_api/routers/lti1p3.py
Original file line number Diff line number Diff line change
Expand Up @@ -964,7 +964,7 @@ async def dynamic_link_entry(request: Request):
rslogger.error(f"LTI1p3 - Error accessing course line items: {e}")
raise HTTPException(
status_code=422,
detail="This course appears to be closed in your Learning Management System.",
detail=f"Error accessing your course's assignments. Your course may be closed in your Learning Management System. Debugging information: {e}",

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

)

l_items.sort(key=lambda li: li.get("label"))
Expand Down
13 changes: 13 additions & 0 deletions components/rsptx/lti1p3/pylti1p3/service_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import typing_extensions as te
from .exception import LtiServiceException, LtiException
from .registration import Registration
from rsptx.logging import rslogger

TServiceConnectorResponse = te.TypedDict(
"TServiceConnectorResponse",
Expand Down Expand Up @@ -113,9 +114,15 @@ async def get_access_token(self, scopes: t.Sequence[str]) -> str:
try:
r = await self._requests_session.post(auth_url, data=auth_request)
if not r.ok:
rslogger.error(
f"get_access_token post failed: {r.status} - {r.reason}. Headers: {r.headers}. Full response: {r.__dict__}"
)
Comment thread
ascholerChemeketa marked this conversation as resolved.
raise LtiServiceException(r)
except Exception:
raw_body = await r.text()
rslogger.error(
f"get_access_token exception caught: {r.status} - {r.reason}. Headers: {r.headers}. Full response: {r.__dict__}"
)
raise LtiServiceException(r)
if r.content_type == "application/json":
response = await r.json()
Expand All @@ -127,6 +134,9 @@ async def get_access_token(self, scopes: t.Sequence[str]) -> str:
response = json.loads(raw_body)
except json.JSONDecodeError:
r.reason = "JSON decode error"
rslogger.error(
f"get_access_token json decode error: {r.status} - {r.reason}. Headers: {r.headers}. Full response: {r.__dict__}"
)
raise LtiServiceException(r)

self._access_tokens[scope_key] = response["access_token"]
Expand Down Expand Up @@ -182,6 +192,9 @@ async def make_service_request(
raise LtiException("Unsupported HTTP method: " + method)

if not r.ok:
rslogger.error(
f"Service request failed: {r.status} - {r.reason}. Headers: {r.headers}. Full response: {r.__dict__}"
)
raise LtiServiceException(r)

next_page_url = None
Expand Down
Loading