From 6b8b65e801f8c52b04fb43cd004c0f589aac56b9 Mon Sep 17 00:00:00 2001 From: David Wolever Date: Tue, 14 Jun 2016 18:10:31 -0400 Subject: [PATCH] Include original OAuth error in LTIExceptions --- pylti/common.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pylti/common.py b/pylti/common.py index b80055e..e54df16 100644 --- a/pylti/common.py +++ b/pylti/common.py @@ -5,6 +5,7 @@ from __future__ import absolute_import import logging +import sys import oauth2 import oauth.oauth as oauth @@ -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