Justin Deoliveira ha scritto: > I think it is a good idea for sure, but the trick is always how to do > throw exceptions at the "service level" that can 1) be usable by the ui > for useful error reporting and 2) not depend on any specific ui classes. > > Providing a hook at the UI level for exceptions seems like the easy > part. The hard part is given an exception, what does it mean? Providing > keys to exceptions rather then messages seems doable, but we have to be > weary of other code that needs to report the exception. Like the > dispatcher. So the stuff that takes the key and parameters and looks up > the appropriate i18n message would have to be available at the "service" > level".
Oh yeah, I did not really think this that deep. I was more concerned about situations that occur at the UI level only. Consider a case in which an admin is using multiple tabs in the browser, keeps a list of layers in one, removes one layer in the other, clicks on the same layer in the first... boom! And "boom" it should be, but somehow controlled. So far I threw IllegalArgumentExceptions or some other sort of exception, was trying to figure out a better way to handle this. Maybe we should just have the code redirect to a well known error page that informs the user of what happened using an error key, and that page then has a link to go back to the home page, and space for a stack trace as well if we want. The same page could be use as a generic error handler, if it does not receive any error key for i18n it can generally report and unexpected error? Cheers Andrea -- Andrea Aime OpenGeo - http://opengeo.org Expert service straight from the developers. ------------------------------------------------------------------------------ Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are powering Web 2.0 with engaging, cross-platform capabilities. Quickly and easily build your RIAs with Flex Builder, the Eclipse(TM)based development software that enables intelligent coding and step-through debugging. Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com _______________________________________________ Geoserver-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geoserver-devel
