Made custom exceptions and put them to use.