Created ErrorHandler and caught some exceptions.