code: public static String getError(JUnitTestData testMethod) {
          String error = "~";
          Throwable t = testMethod.getFailException();
          if (t != null) {
              error = t.getMessage();
          }
          return error;
      }
docs: Get the error message from a given failed JUnit test result
  
  @param testMethod
  @return error message from a given failed JUnit test result