catch errors in on_type_not_found (closes issue #4)