option for scan function to be able to throw error on init

this is usefull when you're testing patterns like we do in plone's mockup and
assertations in some callback of some option that is being proccessed at init
time.
Merge pull request #269 from garbas/master

option for scan function to be able to throw error on init