Closed sebsel closed 7 years ago
This is a classic misunderstanding of mixing transport errors with application errors. HTTP errors indicate that something went wrong with the request you sent. So if you send a request to XRay and XRay can't find a token endpoint, that isn't really your fault, and it's not a problem with XRay or the request, so it returns HTTP 200 instead. This also means your error handling when using XRay can be simplified. If XRay returns HTTP 400 then you probably do want to know about that in an error log. If it returns 200, then there isn't really a problem, and logging that would probably be more noise than useful.
Ah! I was doing a lot of webmention stuff yesterday and there are HTTP codes all over the place. But an error in webmention is actually also an error in the transport. It makes sense now. Thanks for the reply!
The token exchange in /token returns a
200 OK
on the following errors:First, I wanted to file an issue asking to fix this, but I saw that your last commit in XRay/controllers/Token.php is called 'should always return 200'.
So then the question is: why is this? And: could you add that to the docs? :)