[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: las error



On 12/22/2010 1:41 PM, Roland Schweitzer wrote: On 12/21/2010 02:28 PM, John Caron wrote:
On 12/21/2010 12:59 PM, Roland Schweitzer wrote: On 12/21/2010 01:52 PM, John Caron wrote:
ok then, i think this is just a user error, and LAS should return 404 instead of logging an error.
All I know how to do within the IOSP is throw an IO Exception.  How would I return a 404?  Throw a file not found exception?

I think the right thing to do is to set the return code on the HttpResponse and return null from DatasetSource.getNetcdfFile() .
 
      res.sendError(HttpServletResponse.SC_NOT_FOUND, message);

Ill have to look over the code to make sure that is handled correctly everywhere.

For the type of URL we were just dicussing, the DataSource does not run, just the IOSP code.  The IOSP does not have the response object.  In the past you've indicated that an IOException was about the only way to communicate an error.  What it does now is not good.  It should throw an exception rather than run on and try to parse the non-existent XML file, but still don't see how I could send a 404.

Roland


in that case i think you would throw a FileNotFoundException, add the real reason into the exception message. there may be some places where the code needs to deal with that, but the opendap server will work i think.

NOTE: All email exchanges with Unidata User Support are recorded in the Unidata inquiry tracking system and then made publicly available through the web. If you do not want to have your interactions made available in this way, you must let us know in each email you send to us.