code: public boolean checkError() {
          if (out != null) {
              flush();
          }
          if (out instanceof java.io.PrintWriter) {
              PrintWriter pw = (PrintWriter) out;
              return pw.checkError();
          } else if (psOut != null) {
              return psOut.checkError();
          }
          return trouble;
      }
docs: Flushes the stream if it's not closed and checks its error state.
  
  @return <code>true</code> if the print stream has encountered an error,
  either on the underlying output stream or during a format
  conversion.