I think this is a cleaner way of handling errors
Merge pull request #11 from TruckMuncher/errorHandling

Error handling