Adding Error Handling

I added some error classes. Let me know what you think.