add try..except bloc to executor module and refactor unittests code