예제 #1
0
        /// <summary>
        /// Build response model with the exception information.
        /// </summary>
        public string Build()
        {
            ErrorResponse response;

            if (appSettings.IsDevelopmentModeOn)
            {
                response = new ErrorResponse(errorCode, $"Description: {description}. Exception message: {exception.Message}");

                foreach (var point in data)
                {
                    response.AddData(point.Key, point.Value);
                }
            }
            else
            {
                response = new ErrorResponse(errorCode, description);
            }
            return(JsonConvert.SerializeObject(response));
        }