Throw meaningful error if a hook is malformed