public WafActionResponseWrapper GetErrorResponse( ILogger logger, WafActionResponseCodeEnum code, Exception exception, bool skipLogging = false) { return(GetErrorResponse(logger, code, exception?.Message, exception, skipLogging)); }
public WafActionResponseWrapper GetErrorResponse( ILogger logger, WafActionResponseCodeEnum code, string errorMessage, Exception exception = null, bool skipLogging = false) { if (!skipLogging) { if (exception == null) { logger.LogError((int)code, errorMessage); } else { logger.LogError((int)code, exception, errorMessage); } } return(new WafActionResponseWrapper() { Meta = new WafActionResponseMeta(code, errorMessage), }); }
public WafActionResponseMeta(WafActionResponseCodeEnum code, string errorMessage = null) { Code = code; ErrorMessage = errorMessage; }