public void checkError() throws Exception {
  Throwable err=errors.peek();
  if (err != null) {
    if (err instanceof Error)     throw (Error)err;
    throw (Exception)err;
  }
  for (  GridTestThread thread : threads) {
    thread.checkError();
  }
}

public void checkError ( ) throws Exception { Throwable err = errors . peek ( ) ; if ( err != null ) { if ( err instanceof Error ) throw ( Error ) err ; throw ( Exception ) err ; } for ( GridTestThread thread : threads ) { thread . checkError ( ) ; } }
check and throws an exception if happens during this factory threads execution .
