using System.Runtime.Serialization;
using HiVakil.Common.Models.Api;

namespace HiVakil.Common.Models.Exception
{
    [Serializable()]
    public class AppException : System.Exception
    {
        protected AppException(SerializationInfo info, StreamingContext context) : base(info, context) { }

        public ApiResultStatusCode StatusCode { get; set; }
        public AppException()
        {
            StatusCode = ApiResultStatusCode.ServerError;
        }
        public AppException(string message) : base(message)
        {
            StatusCode = ApiResultStatusCode.ServerError;
        }

        public AppException(string message, ApiResultStatusCode statusCode) : base(message)
        {
            StatusCode = statusCode;
        }
    }
}