Skip to content
Browse files

Demo projects throw InvalidResultError instead of ValueError now.

  • Loading branch information...
1 parent 10c5ddc commit 84d4f4c0a111b0e41108bad545f0f483eb05384c @BasicWolf committed
Showing with 3 additions and 1 deletion.
  1. +1 −0 demo/projects/hash_cracker/hash_cracker.py
  2. +2 −1 demo/projects/human_ocr/human_ocr.py
View
1 demo/projects/hash_cracker/hash_cracker.py
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
from hashlib import md5
from kaylee.project import Project, AUTO_PROJECT_MODE
+from kaylee.errors import InvalidResultError
class HashCrackerProject(Project):
mode = AUTO_PROJECT_MODE
View
3 demo/projects/human_ocr/human_ocr.py
@@ -7,6 +7,7 @@
from kaylee.project import Project, MANUAL_PROJECT_MODE
from kaylee.util import random_string
+from kaylee.errors import InvalidResultError
LIPSUM = "Lorem ipsum"
@@ -54,7 +55,7 @@ def __getitem__(self, task_id):
def normalize_result(self, task_id, result):
words = result['captcha'].split()
if words[1].lower() != result['#random_string'].lower():
- raise ValueError('Invalid control parameter value')
+ raise InvalidResultError('Invalid control parameter value')
return words[0]
def result_stored(self, task_id, result, storage):

0 comments on commit 84d4f4c

Please sign in to comment.
Something went wrong with that request. Please try again.