opendap/src/main/java/opendap/dap/DAP2Exception.java
public void print(PrintWriter os)
    {
        os.println("Error {");
        os.println("    code = " + errorCode + ";");
        if(errorMessage != null) os.println("    message = " + dumpword(errorMessage) + ";");
        //if(programType > 0) os.println("    program_type = " + programType + ";");
        if(programSource != null) os.println("    program = " + dumpword(programSource) + ";");
        os.println("};");
    }
public void print(PrintWriter os)
    {
        os.println("Error {");
        os.println("    code = " + errorCode + ";");
        if(errorMessage != null) os.println("    message = " + dumpword(errorMessage) + ";");
        //if(programType > 0) os.println("    program_type = " + programType + ";");
        if(programSource != null) os.println("    program = " + dumpword(programSource) + ";");
        os.println("};");
    }
Print the Error message on the given <code>PrintWriter</code>.
This code can be used by servlets to throw DAP2Exception to client.

@param os the <code>PrintWriter</code> to use for output.