I'm curious about the proper way to handle exceptions in a GeoTools
process that is destined for a GeoServer WPS process. I see that
SimpleProcess, FeatureToFeatureProcess, and others catch exceptions,
call exceptionOccurred on the monitor, and return null from their
execute methods. In cases where a monitor is not provided, a
NullProgressListener is created and does nothing when
exceptionOccurred is called. So when an exception does occur in this
case, a WPS client gets an exception message about "Failed to find
output for execution" but doesn't see additional detail about the
exception.
In GeoServer, when the user provides inadequate/improper input,
typically a WPSException is thrown before the process executes [1],
and the client gets back a useful exception message.
I'm curious what I should do when authoring a process. If I follow
SimpleProcess and others, calling exceptionOccurred on the monitor,
the client will not get back anything useful. Should I be throwing
ProcessException or some other? Should the NullProgressListener do
something else with the exception it receives in exceptionOccurred?
Thanks for any tips,
Tim
[1] But not always, as in https://jira.codehaus.org/browse/GEOS-5315
--
Tim Schaub
OpenGeo http://opengeo.org/
Expert service straight from the developers.