namespace ZB.MOM.WW.MxGateway.Server.Sessions;

public sealed class SessionManagerException : Exception
{
    /// <summary>
    /// Initializes a new instance of <see cref="SessionManagerException"/>.
    /// </summary>
    /// <param name="errorCode">Session manager error code.</param>
    /// <param name="message">Exception message.</param>
    public SessionManagerException(
        SessionManagerErrorCode errorCode,
        string message)
        : base(message)
    {
        ErrorCode = errorCode;
    }

    /// <summary>
    /// Initializes a new instance of <see cref="SessionManagerException"/> with an inner exception.
    /// </summary>
    /// <param name="errorCode">Session manager error code.</param>
    /// <param name="message">Exception message.</param>
    /// <param name="innerException">Inner exception.</param>
    public SessionManagerException(
        SessionManagerErrorCode errorCode,
        string message,
        Exception innerException)
        : base(message, innerException)
    {
        ErrorCode = errorCode;
    }

    /// <summary>
    /// Gets the session manager error code.
    /// </summary>
    public SessionManagerErrorCode ErrorCode { get; }
}
