amagama
amagama copied to clipboard
Do not return 404 on queries for the same language pair
This comes from https://github.com/translate/pootle/issues/4759.
amaGama currently returns a 404 for queries where the source and target language are the same. See https://github.com/translate/amagama/blob/master/amagama/tmdb.py#L441-L443
It was suggested to return a different HTTP error code, but given that that might trigger error handling on Pootle perhaps it is better to instead return an empty result.
As I recall, my idea was to return something so that clients could know if a certain language pair is unsupported. This way they can (hopefully) stop asking, instead of handling the error with each request. I didn't investigate the error codes, but I guess something else might be just as useful if existing users (Pootle and Virtaal) can handle it just as well.
@friedelwolff Would old Virtaal instances be able to handle the scenario where amaGama returns a different HTTP code, or if it returns the message you suggested?