SDL_Android/SmartDeviceLinkAndroidProxy - added the correct version of the proxy
[profile/ivi/smartdevicelink.git] / SDL_Android / SmartDeviceLinkProxyAndroid / src / com / smartdevicelink / exception / SmartDeviceLinkException.java
1 package com.smartdevicelink.exception;\r
2 \r
3 \r
4 public class SmartDeviceLinkException extends Exception {\r
5         \r
6         private static final long serialVersionUID = 5922492291870772815L;\r
7         \r
8         protected Throwable detail = null;\r
9         private SmartDeviceLinkExceptionCause _SmartDeviceLinkExceptionCause = null;\r
10         \r
11         public SmartDeviceLinkException(String msg, SmartDeviceLinkExceptionCause exceptionCause) {\r
12                 super(msg);\r
13                 _SmartDeviceLinkExceptionCause = exceptionCause;\r
14         }\r
15         \r
16         public SmartDeviceLinkException(String msg, Throwable ex, SmartDeviceLinkExceptionCause exceptionCause) {\r
17                 super(msg + " --- Check inner exception for diagnostic details");\r
18                 detail = ex;\r
19                 _SmartDeviceLinkExceptionCause = exceptionCause;\r
20         }\r
21         \r
22         public SmartDeviceLinkException(Throwable ex) {\r
23                 super(ex.getMessage());\r
24                 detail = ex;\r
25         }\r
26         \r
27         public SmartDeviceLinkExceptionCause getSmartDeviceLinkExceptionCause() {\r
28                 return _SmartDeviceLinkExceptionCause;\r
29         }\r
30         \r
31         public Throwable getInnerException() {\r
32                 return detail;\r
33         }\r
34         \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
40                 }\r
41                 if (detail != null) {\r
42                         ret += "\nnested: " + detail.toString();\r
43                         detail.printStackTrace();\r
44                 }\r
45                 return ret;\r
46         }\r
47 }\r