示例#1
0
        public string CreateResponseContent()
        {
            List <CustomError> serviceErrors   = _handlerException.Errors().Select(er => er).ToList();
            string             responseContent = JsonConvert.SerializeObject(serviceErrors);

            return(responseContent);
        }
示例#2
0
 public CQExceptionHandler(CQException handlerException)
 {
     // TODO: Test null input value
     if (handlerException == null || !handlerException.Errors().Any())
     {
         CustomError unkownError = new CustomError(ErrorsCodesContants.UNKNOWN_ERROR_API, ErrorsMessagesConstants.UNKNOWN_ERROR_API, 500);
         _handlerException = new CQException(new List <CustomError> {
             unkownError
         });
     }
     else
     {
         _handlerException = handlerException;
     }
 }