Example #1
0
 public void dap2ExceptionHandler(DAP2Exception de, ReqState rs) {
   rs.getResponse().setHeader("Content-Description", "dods-error");
   rs.getResponse().setContentType("text/plain");
   try {
     de.print(rs.getResponse().getOutputStream());
   } catch (Exception e) {
     System.err.println("dap2ExceptionHandler: " + e);
   }
 }
Example #2
0
  public void parseExceptionHandler(ParseException pe, HttpServletResponse response) {
    try {
      BufferedOutputStream eOut = new BufferedOutputStream(response.getOutputStream());
      response.setHeader("Content-Description", "dods-error");
      response.setContentType("text/plain");

      String msg = pe.getMessage().replace('\"', '\'');

      DAP2Exception de2 = new DAP2Exception(opendap.dap.DAP2Exception.CANNOT_READ_FILE, msg);
      de2.print(eOut);
    } catch (Exception e) {
      System.err.println("parseExceptionHandler: " + e);
    }
  }