//------------------------------------------------------------------------------
// <copyright file="SessionException.java" company="Microsoft">
//      Copyright (c) Microsoft Corporation.  All rights reserved.
// </copyright>
// <summary>
//      SessionException class.
// </summary>
//------------------------------------------------------------------------------

package com.microsoft.hpc.scheduler.session;


import com.microsoft.hpc.exceptions.SOAFaultCode;
import com.microsoft.hpc.exceptions.SR;

/**
 * The class <code>SessionException</code> is a form of <code>Exception</code> that indicates there was an issue with the Microsoft HPC Session
 */
public class SessionException extends Exception
{

    private int errorCode = SOAFaultCode.UnknownError.getCode();
    
    SessionException(Exception e)
    {
        super(SR.ExceptionInCreatingSession, e);
    }
    
    SessionException(String msg)
    {
        super(msg);
    }
    
    SessionException(int errorCode, String msg)
    {
        super(msg);
        this.errorCode = errorCode;
    }
    
    /**
     * Constructs an exception with the specified detail message and the exception that caused it.
     * @param message   the detail message
     * @param innerException    the exception that caused the outer exceptions
     */
    public SessionException(String message, Exception innerException)
    {
        super(message, innerException);
    }
    
    //protected SessionException(SessionInfo info, StreamingContext context)
        //no StreamingContext
    
    public int getErrorCode()
    {
        return this.errorCode;
    }

    /**
     * 
     */
    private static final long serialVersionUID = 6364247049633637822L;
}
