문제

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top