crowdin-cli
crowdin-cli copied to clipboard
`upload translations` doesn't report failure in case of server faults
Describe the bug
crowdin upload translations returns zero exit code (success) despite the fact that half of the files didn't actually upload and there were server errors in the logs.
$ crowdin upload translations -b <redacted> --import-eq-suggestions --plain
❌ Failed to upload the translation file 'Resources/de.lproj/Localizable.strings'. Please contact our support team for help
❌ Error from server: <Code: <empty_code>, Message: Request aborted>
❌ Failed to upload the translation file 'Resources/ru.lproj/Localizable.strings'. Please contact our support team for help
❌ Error from server: <Code: <empty_code>, Message: Request aborted>
❌ Failed to upload the translation file 'Resources/es.lproj/Localizable.strings'. Please contact our support team for help
❌ Error from server: <Code: <empty_code>, Message: Unexpected character ('<' (code 60)): expected a valid value (JSON String, Number, Array, Object or token 'null', 'true' or 'false')
at [Source: (String)"<html>
<head><title>504 Gateway Time-out</title></head>
<body>
<center><h1>504 Gateway Time-out</h1></center>
<hr><center>nginx</center>
</body>
</html>
"; line: 1, column: 2]>
❌ Failed to upload the translation file 'Resources/uk.lproj/Localizable.strings'. Please contact our support team for help
❌ Error from server: <Code: <empty_code>, Message: Unexpected character ('<' (code 60)): expected a valid value (JSON String, Number, Array, Object or token 'null', 'true' or 'false')
at [Source: (String)"<html>
<head><title>504 Gateway Time-out</title></head>
<body>
<center><h1>504 Gateway Time-out</h1></center>
<hr><center>nginx</center>
</body>
</html>
"; line: 1, column: 2]>
Resources/es.lproj/AppShortcuts.strings
Resources/fr.lproj/AppShortcuts.strings
Resources/uk.lproj/AppShortcuts.strings
....
All this kept working and ended up with the zero (success) exit code.
Expected behavior
Exit with non-zero exit code if anything goes wrong during upload. Otherwise we end up with corrupted localization.
Environment:
- OS: macOS
- Version: 14.4.1