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

The raising exception in the last few lines doesn't work #23

Open
SpaceFlyer opened this issue Nov 14, 2014 · 3 comments
Open

The raising exception in the last few lines doesn't work #23

SpaceFlyer opened this issue Nov 14, 2014 · 3 comments

Comments

@SpaceFlyer
Copy link
Contributor

I didn't set 'lib' in my path so an exception occurred:

Traceback (most recent call last):

  File "C:\Users\SpaceFlyer\Dropbox\programming\orderonline\OrderOnline\engineauth\middleware.py", line 162, in _load_strategy

    return utils.import_class(strategy_location)

  File "C:\Users\SpaceFlyer\Dropbox\programming\orderonline\OrderOnline\engineauth\utils.py", line 29, in import_class

    mod = __import__(path, fromlist=[klass])

  File "C:\Users\SpaceFlyer\Dropbox\programming\orderonline\OrderOnline\engineauth\strategies\google.py", line 3, in 

    from apiclient.discovery import build

ImportError: No module named apiclient.discovery

INFO     2014-11-14 02:38:29,122 middleware.py:165] No module named apiclient.discovery

But instead of reporting the above exception, the last few lines generated the following information in app engine console, which is very confusing:

ERROR    2014-11-14 02:29:44,747 wsgi.py:278] 

Traceback (most recent call last):

  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\runtime\wsgi.py", line 266, in Handle

    result = handler(dict(self._environ), self._StartResponse)

  File "C:\Users\SpaceFlyer\Dropbox\programming\orderonline\OrderOnline\engineauth\middleware.py", line 147, in __call__

    strategy_class = self._load_strategy(provider)

  File "C:\Users\SpaceFlyer\Dropbox\programming\orderonline\OrderOnline\engineauth\middleware.py", line 166, in _load_strategy

    "'provider.{0}' config dict".format(provider))

Exception
@kylefinley
Copy link
Member

@SpaceFlyer,

Thank you for reporting this. Do you have a suggestion for a better way to handle this? Or better yet would you mind submitting a pull request?

Thanks,
Kyle

@SpaceFlyer
Copy link
Contributor Author

@kylefinley

I simply added traceback.print_exc() in that except Exception, e: clause. I'm not sure whether it's the best way but it surely helps me. How do you think about that? If you think it's Ok, I'll submit the pull request.

Thanks,
Yuqian

@kylefinley
Copy link
Member

Sounds Great!

Thanks @SpaceFlyer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants