Error/Exception Response can't be serialized to JSON with StackTrace

With DebugMode = true a get an error in browser and Advanced Rest Client if an Exception is returned:

Unexpected token

It works fine, if no StrackTrace is included in Response.

Force AuthError by sending wrong login to: http://localhost:14000/auth/credentials

Please provide the version of ServiceStack you’re using and the raw HTTP response (you can get with Fiddler or Web inspector)

Version: 4.0.41

Raw-Response from Chrome Network-Tab:

{"responseStatus":{"errorCode":"ValidationException","message":"Validation failed: \

– ‘User Name’ should not be empty.

– ‘Password’ should not be empty.",“stackTrace”:"[Authenticate: 06.06.2015 15:50:50]:
[REQUEST: {provider:credentials}]
ServiceStack.FluentValidation.ValidationException: Validation failed:

– ‘User Name’ should not be empty.

– ‘Password’ should not be empty.

bei ServiceStack.FluentValidation.DefaultValidatorExtensions.ValidateAndThrow[T](IValidator1 validator, T instance)\ \ bei ServiceStack.Auth.CredentialsAuthProvider.Authenticate(IServiceBase authService, IAuthSession session, Authenticate request)\ \ bei ServiceStack.Auth.AuthenticateService.Authenticate(Authenticate request, String provider, IAuthSession session, IAuthProvider oAuthConfig)\ \ bei ServiceStack.Auth.AuthenticateService.Post(Authenticate request)\ \ bei lambda_method(Closure , Object , Object )\ \ bei ServiceStack.Host.ServiceRunner1.Execute(IRequest request, Object instance, TRequest requestDto)",“errors”:[{“errorCode”:“NotEmpty”,“fieldName”:“UserName”,“message”:"‘User Name’ should not be empty."},{“errorCode”:“NotEmpty”,“fieldName”:“Password”,“message”:"‘Password’ should not be empty."}]}}

Ok thanks there’s was a bug at one stage in the pre-release v4.0.41 MyGet packages which had this issue, you can resolve this by clearing your NuGet Cache and deleting the /packages folder in order to redownload the latest MyGet packages.

Thanks - works! :thumbsup: