ErrorHandler

Created a class to handle errors properly.