opendap/src/main/java/opendap/servlet/AbstractServlet.java
public void dap2ExceptionHandler(DAP2Exception de, HttpServletResponse response) {
    log.info("DODSServlet.dodsExceptionHandler (" + de.getErrorCode() + ") " + de.getErrorMessage());

    if (Debug.isSet("showException")) {
      de.print(System.err);
      de.printStackTrace(System.err);
      printDODSException(de);
    }

    try {
      BufferedOutputStream eOut = new BufferedOutputStream(response.getOutputStream());

      response.setHeader("Content-Description", "dods-error");

      // This should probably be set to "plain" but this works, the
      // C++ slients don't barf as they would if I sent "plain" AND
      // the C++ don't expect compressed data if I do this...
      response.setHeader("Content-Encoding", "");
      de.print(eOut);

    } catch (IOException ioe) {
      log.error("Cannot respond to client! IO Error: " + ioe.getMessage());
    }


  }
public void dap2ExceptionHandler(DAP2Exception de, HttpServletResponse response) {
    log.info("DODSServlet.dodsExceptionHandler (" + de.getErrorCode() + ") " + de.getErrorMessage());

    if (Debug.isSet("showException")) {
      de.print(System.err);
      de.printStackTrace(System.err);
      printDODSException(de);
    }

    try {
      BufferedOutputStream eOut = new BufferedOutputStream(response.getOutputStream());

      response.setHeader("Content-Description", "dods-error");

      // This should probably be set to "plain" but this works, the
      // C++ slients don't barf as they would if I sent "plain" AND
      // the C++ don't expect compressed data if I do this...
      response.setHeader("Content-Encoding", "");
      de.print(eOut);

    } catch (IOException ioe) {
      log.error("Cannot respond to client! IO Error: " + ioe.getMessage());
    }


  }
public void dap2ExceptionHandler ( DAP2Exception de , HttpServletResponse response ) { log . info ( "DODSServlet.dodsExceptionHandler (" + de . getErrorCode ( ) + ") " + de . getErrorMessage ( ) ) ; if ( Debug . isSet ( "showException" ) ) { de . print ( System . err ) ; de . printStackTrace ( System . err ) ; printDODSException ( de ) ; } try { BufferedOutputStream eOut = new BufferedOutputStream ( response . getOutputStream ( ) ) ; response . setHeader ( "Content-Description" , "dods-error" ) ; // This should probably be set to "plain" but this works, the // C++ slients don't barf as they would if I sent "plain" AND // the C++ don't expect compressed data if I do this... response . setHeader ( "Content-Encoding" , "" ) ; de . print ( eOut ) ; } catch ( IOException ioe ) { log . error ( "Cannot respond to client! IO Error: " + ioe . getMessage ( ) ) ; } }
************************************************************************
Sends a OPeNDAP DAP2 error to the client.

@param de       The OPeNDAP DAP2 exception that caused the problem.
@param response The <code>HttpServletResponse</code> for the client.
************************************************************************ Sends a OPeNDAP DAP2 error to the client .