All Downloads are FREE. Search and download functionalities are using the official Maven repository.

javapns.notification.exceptions.PayloadMaxSizeExceededException Maven / Gradle / Ivy

The newest version!
package javapns.notification.exceptions;

/**
 * Thrown when a payload exceeds the maximum size allowed.
 * @author Sylvain Pedneault
 *
 */
@SuppressWarnings("serial")
public class PayloadMaxSizeExceededException extends Exception {

	/**
	 * Default constructor
	 */
	public PayloadMaxSizeExceededException() {
		super("Total payload size exceeds allowed limit");
	}


	public PayloadMaxSizeExceededException(int maxSize) {
		super(String.format("Total payload size exceeds allowed limit (%s bytes max)", maxSize));
	}


	public PayloadMaxSizeExceededException(int maxSize, int currentSize) {
		super(String.format("Total payload size exceeds allowed limit (payload is %s bytes, limit is %s)", currentSize, maxSize));
	}


	/**
	 * Constructor with custom message
	 * @param message
	 */
	public PayloadMaxSizeExceededException(String message) {
		super(message);
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy