I don't see removing that function as a solution, we could re work it so that it communicates the error that you need to build the project.
i don't have permission issue writing exception.txt but could see another way of fixing the function to not use a file and keep it all in vars if you wanted to rework your patch or chmod a+rw in your folder maybe not sure how you are running things but you should build first (see README)
Joes-MacBook-Air:kafka joestein$ bin/kafka-list-topic.sh
Missing required argument "[zookeeper]"
--topic <topic> REQUIRED: The topic to be listed.
Defaults to all existing topics.
--unavailable-partitions if set, only show partitions whose
leader is not available
--under-replicated-partitions if set, only show under replicated
--zookeeper <urls> REQUIRED: The connection string for
the zookeeper connection in the form
host:port. Multiple URLS can be
given to allow fail-over.