From 799fb6645b74348db5a74f6a23fd8754aae00ef9 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 14 Nov 2009 11:20:38 -0700 Subject: [PATCH] IGN: Nytimes recipe now throws a useful error when login fails --- resources/recipes/nytimes_sub.recipe | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/resources/recipes/nytimes_sub.recipe b/resources/recipes/nytimes_sub.recipe index 07db16daa4..a2c805c299 100644 --- a/resources/recipes/nytimes_sub.recipe +++ b/resources/recipes/nytimes_sub.recipe @@ -35,7 +35,10 @@ class NYTimes(BasicNewsRecipe): br.select_form(name='login') br['USERID'] = self.username br['PASSWORD'] = self.password - br.submit() + raw = br.submit().read() + if 'Sorry, we could not find the combination you entered. Please try again.' in raw: + raise Exception('Your username and password are incorrect') + #open('/t/log.html', 'wb').write(raw) return br def parse_index(self):