using System;
using System.Collections.Generic;
using System.Text;

using Betfair.Gamex.API.Entities;

namespace Betfair.Gamex.API
{
    /// <summary>
    /// Wraps error from API
    /// </summary>
    public class APIException : Exception
    {
        private error m_Error;

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="err"></param>
        public APIException(error err) : base(err.errorCode.ToString())
        {
            m_Error = err;
        }

        /// <summary>
        /// Error code from API
        /// </summary>
        public error Error
        {
            get
            {
                return m_Error;
            }
        }
    }
}
