Ejemplo n.º 1
0
 /**
  * Exit if klass has the same type or sub-type as throwable or one of its causes. If exiting, emit
  * message.
  */
 private static void exitIfThrowableMatches(
     Throwable throwable, Class klass, Errno errno, String message) {
   Throwable cause = Throwables2.getFirstThrowableOfType(throwable, klass);
   if (cause == null) {
     return;
   }
   System.err.format("%s: %s\n", message, cause.getMessage());
   System.exit(errno.getErrno());
 }
Ejemplo n.º 2
0
 @Override
 public String toString() {
   if (Shell.WINDOWS) return errorCode + ": " + super.getMessage();
   else return errno.toString() + ": " + super.getMessage();
 }