#6615 - Added a better error message for --ls

My first pull request, made the error message better to close #6615.