1

I am using ServiceStack version 3.9.71 and I cannot find the "Add" method. Is the documentation on the wiki outdated? What should I do in order to make it work?

public override void Configure(Container container)
{
    this.ServiceExceptionHandler.Add((httpReq, request, exception) => {
        return DtoUtils.CreateErrorResponse(request, exception);
    });
}
Scott
  • 21,211
  • 8
  • 65
  • 72
Daniel Gartmann
  • 11,678
  • 12
  • 45
  • 60

1 Answers1

5

You are looking at the v4 documentation. You need the v3 documentation.

//Handle Exceptions occurring in Services:
this.ServiceExceptionHandler = (httpReq, request, exception) => {
    //log your exceptions here
    ...
    //call default exception handler or prepare your own custom response
    return DtoUtils.HandleException(this, request, exception);
};

Note the v3's in the url: https://github.com/ServiceStackv3/ServiceStackv3/wiki

Scott
  • 21,211
  • 8
  • 65
  • 72