/*
 * Created on Jul 2, 2008 (C) Copyright TANDBERG Television Ltd.
 */

package com.tandbergtv.watchpoint.pmm.communication;

/**
 * Exception thrown by the Message Handler when handling the incoming workflow message. Always
 * contains an error code.
 * 
 * @author Vijay Silva
 */
public class MessageHandlerException extends Exception {

	/* Serialization UID */
	private static final long serialVersionUID = 7609111498992733920L;

	/* The Error Code */
	private String errorCode;

	/**
	 * Default Constructor
	 * 
	 * @param errorCode The error code
	 */
	public MessageHandlerException(String errorCode) {
		super();
		this.errorCode = errorCode;
	}

	/**
	 * @param errorCode the error code
	 * @param message The detail message
	 */
	public MessageHandlerException(String errorCode, String message) {
		super(message);
		this.errorCode = errorCode;
	}

	/**
	 * @param errorCode The error code
	 * @param cause The cause
	 */
	public MessageHandlerException(String errorCode, Throwable cause) {
		super(cause);
		this.errorCode = errorCode;
	}

	/**
	 * @param errorCode The error code
	 * @param message The detail message
	 * @param cause The cause
	 */
	public MessageHandlerException(String errorCode, String message, Throwable cause) {
		super(message, cause);
		this.errorCode = errorCode;
	}

	/**
	 * Get the Error Code associated with this exception.
	 * 
	 * @return The error code
	 */
	public String getErrorCode() {
		return errorCode;
	}
}
