code: public boolean checkError() {
          if (out != null)
              flush();
          if (out instanceof java.io.PrintStream) {
              PrintStream ps = (PrintStream) out;
              return ps.checkError();
          }
          return trouble;
      }
docs: Flushes the stream and checks its error state. The internal error state
  is set to <code>true</code> when the underlying output stream throws an
  <code>IOException</code> other than <code>InterruptedIOException</code>,
  and when the <code>setError</code> method is invoked.  If an operation
  on the underlying output stream throws an
  <code>InterruptedIOException</code>, then the <code>PrintStream</code>
  converts the exception back into an interrupt by doing:
  <pre>
  Thread.currentThread().interrupt();
  </pre>
  or the equivalent.
  
  @return <code>true</code> if and only if this stream has encountered an
  <code>IOException</code> other than
  <code>InterruptedIOException</code>, or the
  <code>setError</code> method has been invoked