Added exception handler to both parser and test