[Multigraph-users] Best practice for handling errors within a web service used by the Multigraph Fl
Brought to you by:
mphillips
|
From: James A. <mon...@gm...> - 2011-11-15 16:38:19
|
I have a Flex application that uses the Multigraph Flex Component. When I construct this component in my application code I specify a URL to a web service that will respond with MUGL for the multigraph. This web service is a Java Servlet. If there is an error processing the MUGL request then I want to display a meaningful message to the user (in the Flex client application), as well as logging the error and sending a message to alert the developer (me) of the issue. What is the best way for the web service servlet to respond to an error such as an invalid request parameter? Are there certain HTTP response codes that this Multigraph Flex Component is aware of and handles gracefully? For example: My application creates a Multigraph component and sets the web service URL (i.e. the Multigraph component's muglfile attribute/property) to something which contains a bad request parameter: multiGraph.muglfile = "http://jadams.ncdc.noaa.gov/graphapp/mugl_for_station?station_code=INVALID_STATION_CODE"; What is the best way to handle the error in my web service code? When I catch the error I can throw an exception from the servlet, and this will create an HTTP response with a non-200 HTTP response code -- can the Multigraph component handle this, and if so how do I capture the error message? Thanks for any suggestions. --James |