1 package com.smartdevicelink.exception;
\r
4 public class SmartDeviceLinkException extends Exception {
\r
6 private static final long serialVersionUID = 5922492291870772815L;
\r
8 protected Throwable detail = null;
\r
9 private SmartDeviceLinkExceptionCause _SmartDeviceLinkExceptionCause = null;
\r
11 public SmartDeviceLinkException(String msg, SmartDeviceLinkExceptionCause exceptionCause) {
\r
13 _SmartDeviceLinkExceptionCause = exceptionCause;
\r
16 public SmartDeviceLinkException(String msg, Throwable ex, SmartDeviceLinkExceptionCause exceptionCause) {
\r
17 super(msg + " --- Check inner exception for diagnostic details");
\r
19 _SmartDeviceLinkExceptionCause = exceptionCause;
\r
22 public SmartDeviceLinkException(Throwable ex) {
\r
23 super(ex.getMessage());
\r
27 public SmartDeviceLinkExceptionCause getSmartDeviceLinkExceptionCause() {
\r
28 return _SmartDeviceLinkExceptionCause;
\r
31 public Throwable getInnerException() {
\r
35 public String toString() {
\r
36 String ret = this.getClass().getName();
\r
37 ret += ": " + this.getMessage();
\r
38 if(this.getSmartDeviceLinkExceptionCause() != null){
\r
39 ret += "\nSmartDeviceLinkExceptionCause: " + this.getSmartDeviceLinkExceptionCause().name();
\r
41 if (detail != null) {
\r
42 ret += "\nnested: " + detail.toString();
\r
43 detail.printStackTrace();
\r