Would a better solution then be to just change the TMC exception to be a checked one? (I don't quite like this either, as it forces me to use try/catch blocks, even if I choose not to do anything to handle this exception, but....)
Otis --- Erik Hatcher <[EMAIL PROTECTED]> wrote: > On Wednesday, November 26, 2003, at 06:51 AM, Otis Gospodnetic > wrote: > > Hm, I'm not sure if I like this change. > > Yes, this change makes it easier to handle TooManyClauses > exception, > > but the cause exception has nothing to do with parsing, and > wrapping it > > in ParseException hides that. > > It sort of does have something to do with the parsing though.... in > that something the user typed parsed to an invalid query. > > > I prefer leaving things like before. Anyone who uses Lucene for > > serious business should have read the Javadoc for various queries, > and > > not just the QueryParser, so complaining that this is only > documented > > in BooleanQuery javadoc is not a good excuse, IMHO. > > I tend to disagree with this. And perhaps it has to do with my > opinions on exceptions. Runtime exceptions are pretty rude if they > were meant to be caught. QueryParser is for attaching a UI for user > entered queries. > > I would agree with you more if TooManyClauses was a checked exception > > so that it would have to be dealt with for developers using > QueryParser. > > > Furthemore, anyone who uses QueryParser should know that > ParseException > > will be thrown every once in a while, when users enter a query with > > invalid syntax, and such. Entering a Prefix or Wildcard query that > > results in more than 1024 BooleanQueries is not the result of > invalid > > query syntax, but indicates a different problem, which those > running > > the Lucene-based application may want to know about and handle > > differently. > > > > What do you think? > > I still think the only thing that should come from the parse method > is > a ParseException, unless it is truly a runtime exception that could > not > be handled any other way. > > I'm fine backing it out if that is the consensus, but I personally as > a > user of QueryParser myself am not fond of the mysterious runtime > exceptions thrown from within Lucene's codebase propagating all the > way > back out rather than being wrapped. > > Erik > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > __________________________________ Do you Yahoo!? Free Pop-Up Blocker - Get it now http://companion.yahoo.com/ --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]