code: public static String getMessage(IOException e) {
          String s = e.getLocalizedMessage();
          if (s != null)
              return s;
          s = e.getMessage();
          if (s != null)
              return s;
          return e.toString();
      }
docs: Get a detail message from an IOException.
  Most, but not all, instances of IOException provide a non-null result
  for getLocalizedMessage().  But some instances return null: in these
  cases, fallover to getMessage(), and if even that is null, return the
  name of the exception itself.
  @param e an IOException
  @return a string to include in a compiler diagnostic