Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Service always returns 200 with CompressResponseAttribute #533

Closed
svantreeck opened this issue Apr 18, 2017 · 2 comments
Closed

Service always returns 200 with CompressResponseAttribute #533

svantreeck opened this issue Apr 18, 2017 · 2 comments
Assignees

Comments

@svantreeck
Copy link

When I add a [CompressResponse] attribute to my service, when an error is thrown, I can see that it is thrown via logging; however, the client receives a response with a 200 status code (and a serialized version of the error in it's ResponseStatus property). I am expecting to get a 404/403/etc in this situation.

[CompressResponse]
public class ThingService : Service 
{
        
        public object Get(GetThing request)
        {
            var thing = repo.Get(request.Id);

            if (thing == null)
            {
                throw HttpError.NotFound($"Thing {request.Id} not found");
            }
            ...
        }
}
@mythz mythz self-assigned this Apr 19, 2017
@mythz
Copy link
Member

mythz commented Apr 19, 2017

ouch, should now be fixed with this commit which is available from v4.5.9 that's now on MyGet

thx for reporting!

@mythz mythz closed this as completed Apr 19, 2017
@svantreeck
Copy link
Author

Thanks for the quick fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants