抛出HttpStatusCode.OK异常时,Hangfire作业失败

时间:2019-11-06 09:56:47

标签: hangfire

我有一个Hangfire工作,在特定条件下会引发自定义HttpStatusCode.OK异常。

但是我不希望工作在这种情况下失败。

if (!te.HasVariables && !te.HasCountries)
{
  throw new CustomHttpException(HttpStatusCode.OK, $"Data is empty for Countries.");
}

0 个答案:

没有答案