public async Task WriteErrorResponseAsync(
            HttpContext context,
            HttpStatusCode code,
            IDictionary <string, object> inputErrors,
            CustomErrorCode customErrorCode,
            string customMessageOverride)
        {
            var response = context.Response;

            response.ContentType = "application/json; charset=utf8";
            response.StatusCode  = (int)code;

            await response
            .WriteAsync(JsonConvert.SerializeObject(new
            {
                error = new ErrorResponse
                {
                    Message      = string.IsNullOrWhiteSpace(customMessageOverride) ? customErrorCode.GetEnumDescription() : customMessageOverride,
                    LogstashLink = _env.IsDevelopment() ? "Логи не доступны для среды разработки" : GetLogstashLink(context),
                    InputErrors  = inputErrors,
                    Code         = customErrorCode,
                },
            }))
            .ConfigureAwait(false);
        }
 public BadUserInputException(CustomErrorCode customErrorCode) : base(customErrorCode.GetEnumDescription())
 {
     CustomErrorCode = customErrorCode;
 }