forked from ringcentral/pubnub-jtools
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPubnubException.java
More file actions
61 lines (52 loc) · 1.34 KB
/
Copy pathPubnubException.java
File metadata and controls
61 lines (52 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
package com.pubnub.api;
/**
* PubnubException is thrown by various Pubnub APIs
*
* @author PubnubCore
*/
public class PubnubException extends Exception {
private String errormsg = "";
private PubnubError pubnubError = PubnubError.PNERROBJ_PUBNUB_ERROR;
/**
* Constructor for PubnubException Class with error message as argument
*
* @param s
* Error message
*/
public PubnubException(String s) {
this.errormsg = s;
}
/**
* Constructor for PubnubException Class with error message as argument
*
* @param pubnubError
* Error message
*/
public PubnubException(PubnubError pubnubError) {
this.pubnubError = pubnubError;
}
/**
* Constructor for PubnubException Class with error message as argument
*
* @param s
* Error message
*/
public PubnubException(PubnubError pubnubError, String s) {
this.errormsg = s;
this.pubnubError = pubnubError;
}
/**
* Read the exception error message
*
* @return String
*/
public String toString() {
String msg = pubnubError.toString();
if (errormsg.length() > 0 )
msg = msg + " . " + errormsg;
return msg;
}
public PubnubError getPubnubError() {
return pubnubError;
}
}