Added error handler class to design pattern