Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include original OAuth error in LTIExceptions #59

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
5 changes: 3 additions & 2 deletions pylti/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

from __future__ import absolute_import
import logging
import sys

import oauth2
import oauth.oauth as oauth
Expand Down Expand Up @@ -303,10 +304,10 @@ def verify_request_common(consumers, url, method, headers, params):
# pylint: disable=protected-access
consumer = oauth_server._get_consumer(oauth_request)
oauth_server._check_signature(oauth_request, consumer, None)
except oauth.OAuthError:
except oauth.OAuthError as e:
# Rethrow our own for nice error handling (don't print
# error message as it will contain the key
raise LTIException("OAuth error: Please check your key and secret")
raise LTIException("OAuth error: %s" %(e.message, )), None, sys.exc_info()[2]

return True

Expand Down