code: public void exceptionOccured( Throwable t )
      {
          if (t instanceof RuntimeException)
          {
              err.println( "An unexpected error occured" );
              t.printStackTrace( err );
          }
          else
          {
              err.println( format("Error: %s %s", t.getClass().getName(), t.getMessage()) );
              if (t.getCause() != null)
              {
                  err.println( "Caused by:" );
                  t.getCause().printStackTrace( err );
              }
          }
      }
docs: {@inheritDoc}