fix(directives): fixed error handling in directives registry