From 6e02b9f8c1e8b284c72bd69d8e31997a43bdb06b Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 11 Jul 2017 23:22:30 +0530 Subject: [PATCH] Log failed login URL --- recipes/wsj.recipe | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/recipes/wsj.recipe b/recipes/wsj.recipe index 6d711d89c0..fc15961770 100644 --- a/recipes/wsj.recipe +++ b/recipes/wsj.recipe @@ -147,7 +147,11 @@ class WSJ(BasicNewsRecipe): raise ValueError( 'Failed to login (XHR failed), check username and password') br.set_cookie('m', data['username'], '.wsj.com') - r = br.open(data['url']) + try: + r = br.open(data['url']) + except Exception: + self.log.error('Failed to open login url: {}'.format(data['url'])) + raise self.wsj_itp_page = raw = r.read() if b'>Sign Out<' not in raw: raise ValueError(