public static SecurityExceptionClientHandler GetInstance()
 {
     if (_instance == null)
     {
         _instance = new SecurityExceptionClientHandler();
     }
     return(_instance);
 }
        public override CompositeFillErrors Run(Exception ex)
        {
            SecurityExceptionClientHandler myex = (SecurityExceptionClientHandler)ex;

            return(new CompositeFillErrors()
            {
                Field = "general_errors", Message = ex.Message
            });
        }
        private void FillExceptions()
        {
            Handlers = new List <BaseExceptionClientHandler>();
            Handlers.Add(SecurityExceptionClientHandler.GetInstance());
            Handlers.Add(HalExceptionClientHandler.GetInstance());
            Handlers.Add(JsonHalExceptionClientHandler.GetInstance());

            BaseExceptionClientHandler _handler;

            for (int i = 0; i <= Handlers.Count(); i++)
            {
                _handler = Handlers.ElementAt(i);
                if (i + 1 == Handlers.Count())
                {
                    break;
                }
                _handler.Mychainhandler = Handlers.ElementAt(i + 1);
            }
        }