Hi,
http://jira.codehaus.org/browse/GEOS-1155 is leading me down on a path
to hell.
To recap what's going on for those that aren't informed, we where throwing a classcast exception when translating a filter into sql
due to a bug in the filter splitter, and the bug triggered
because one of the attributes used in the filter was inexistent.
Yet, even with that bug fixed, the error reported is still useless:
"null error:Translator error"
This happens because the GML translator report only that message,
and we don't attach in any way the real error messages, which is
in the nested exception:
java.lang.IllegalArgumentException: Property 'full_name_lc' could not be found in gnis_pop
Ok, so, what do we do? I have various options in mind, like none of
them:
* change the GML translator so that exception is built like:
e = new TransformerException("Translator error" + e.getMessage(),e);
This solves the issue with the least effort, provided that the
real cause is reported at the first level. Or we could go and look
for the most nested exception.
Yet, what would happen if we did the same treatment to all
exceptions? The errors messages would go wild I fear
* report the full stack trace, like we do in WFS module, Geoserver
trunk. Hum, this one is better, yet the message is a bit criptic
* do a middle version, that is, we print only the messages of
each exception in the chain (that is, a summary of the stack trace).
In the above case, the output could look like:
Translation Error
Property 'full_name_lc' could not be found in gnis_pop
Seems to be decent enough for a human being to read.
What do you think? Any bright idea?
Oh, besides that, exception reporting in Geoserver is all over the
place. We should have a single service exception class that wraps the exception and applies whatever solution we want... ServiceException
seems the one, but its constructors allows for a wide variety of
behaviours (only the message, message + exception, message + locator,
you name it, and code that builds error messages its own way, and so on)... I'd like to pin this down and have a single consistent
way of reporting service exception in the code.
Cheers
Andrea