Implements functions throwing the four main types of errors
Merge pull request #16 from jbbrokaw/session1-task4

Looks good.