Changed the error messages in the except blocks to reflect what function they correspond to.