1 33 package net.myvietnam.mvncore.exception; 34 35 44 public class ImportException extends Exception { 45 46 private Exception exception; 47 48 public ImportException() { 49 super(); 50 this.exception = null; 51 } 52 53 public ImportException(String message) { 54 super(message); 55 this.exception = null; 56 } 57 58 public ImportException(Exception e) { 59 super(); 60 this.exception = e; 61 } 62 63 public ImportException(String message, Exception e) { 64 super(message); 65 this.exception = e; 66 } 67 68 public String getMessage() { 69 String message = super.getMessage(); 70 71 if (exception != null) { 72 return message + " Detail: " + exception.getMessage(); 73 } 74 return message; 75 } 76 77 public Exception getException() { 78 return exception; 79 } 80 81 public String toString() { 82 if (exception != null) { 83 return exception.toString(); 84 } 85 return super.toString(); 86 } 87 88 } 89 | Popular Tags |