The signature for ServiceExceptionHandler
is now:
ServiceExceptionHandler += (httpReq, request, exception) => { .. }
I recommend joining the ServiceStack G+ Community to get notified of any breaking changes during releases.
题
We have recently updated the version of ServiceStack.Logging.Elmah and the code that used to work in our older version no longer works:
ServiceExceptionHandler += (request, exception) =>
{
var context = HttpContext.Current;
Elmah.ErrorLog.GetDefault(context).Log(new Error(exception,context));
return DtoUtils.HandleException(this, request, exception);
};
It doesnt compile on the exception variables for new Error(). I have tried casting them to Exception but this just causes another error on the whole lot of code 'Cannot apply operator '+=' to operands of type 'ServiceStack.WebHost.Endpoints.HandleServiceExceptionDelegate' and 'lambda expression'. Struggling to find any documentation for the update, could anyone let me know what the code change is?
解决方案
The signature for ServiceExceptionHandler
is now:
ServiceExceptionHandler += (httpReq, request, exception) => { .. }
I recommend joining the ServiceStack G+ Community to get notified of any breaking changes during releases.