list: Adding exception handling with prettier error reporting when a directory contains an invalid package

Fixes #76.