public FeedReaderErrorHandler(ModelStateDictionary modelState)
        {
            _httpStatusCode = HttpStatusCode.BadRequest;
            _errorinfo = new FeedReaderError(FeedReaderErrorType.InvalidRequest, "Request Validation Error");

            foreach (var state in modelState)
            {
                foreach (var error in state.Value.Errors)
                {
                    FeedReaderErrorCode errorCode = GetModelStateErrorCode(error.ErrorMessage);
                    _errorinfo.AddDetail(errorCode, error.ErrorMessage);
                }
            }
        }
        public FeedReaderErrorHandler(Exception ex)
        {
            if (ex is SqlException)
            {
                _errorinfo = new FeedReaderError(FeedReaderErrorType.DataSourceError, "Data Source Error");

                SqlException sqlEx = (SqlException)ex;

            }
            else
            {
                _httpStatusCode = HttpStatusCode.InternalServerError;
                _errorinfo = new FeedReaderError(FeedReaderErrorType.UnknownError, "System Error!");
            }
        }
 public FeedReaderErrorHandler()
 {
     _errorinfo = new FeedReaderError(FeedReaderErrorType.UnknownError, "Unknown error occured! Please try again later.");
 }
        private FeedReaderError GetSqlError(SqlError []sqlErrors)
        {
            foreach (SqlError error in sqlErrors)
            {
                int errorNumber = error.Number;
            }

            var frError = new FeedReaderError(FeedReaderErrorType.UnknownError, "TestMessage");

            return frError;
        }