amagama icon indicating copy to clipboard operation
amagama copied to clipboard

Do not return 404 on queries for the same language pair

Open unho opened this issue 8 years ago • 2 comments

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.

unho avatar May 31 '16 10:05 unho

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 avatar Jun 02 '16 09:06 friedelwolff

@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?

unho avatar Jun 02 '16 10:06 unho