Open foldleft opened 1 month ago
I definitely agree a 500 doesn't make sense here for these kinds of errors.
I'm not sure a 501 makes sense because I think of that as being a server to handle the request in the service, not one upstream... would something in the 4xx make more sense/ be something Zotero would be willing to merge?
I think 500 or 503 are appropriate – it's not quite acting as a gateway, but 503 does get the sense of the error being because of a downstream service.
The 501 there is just a temporary nginx configuration I set up for testing.
At present if the remote service returns an error we get an undifferentiated 500 back from translation-server. This means we cannot distinguish between a 403, a 404 or a 500. This change allows us to log what happened.
Testing
I created a directory called
nginx-force-response
and populatedconf.d/default.conf
with a file like this (but with more entries):And then used it like so:
docker run --rm --name nginx -v $PWD/conf.d:/etc/nginx/conf.d -p 8080:80 nginx
Finally, I was able to test like this: