Error handling in `library` and `cat`