Throw exception if hooks are in bad format