Add some error handling capability to parser