com.pubnub.api.PubnubException Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pubnub-android-debug Show documentation
Show all versions of pubnub-android-debug Show documentation
PubNub is a cross-platform client-to-client (1:1 and 1:many) push service in the cloud, capable of broadcasting real-time messages to millions of web and mobile clients simultaneously, in less than a quarter second!
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;
}
}