Better error handling of parser exceptions