fix: Expose the Baidu error if translation is not successful - #212
Merged
Green-Sky merged 1 commit intoSep 8, 2026
Merged
Conversation
Contributor
|
Tip Preview URL: |
nickolay168
force-pushed
the
nickolay168/better_error_diagnostics
branch
from
September 6, 2026 06:55
67841bd to
ea9f33b
Compare
nickolay168
marked this pull request as ready for review
September 6, 2026 07:02
Green-Sky
approved these changes
Sep 6, 2026
nickolay168
force-pushed
the
nickolay168/better_error_diagnostics
branch
from
September 8, 2026 03:32
ea9f33b to
3428eb8
Compare
nickolay168
force-pushed
the
nickolay168/better_error_diagnostics
branch
from
September 8, 2026 03:54
3428eb8 to
d3f5ad6
Compare
nickolay168
force-pushed
the
nickolay168/better_error_diagnostics
branch
from
September 8, 2026 03:58
d3f5ad6 to
01236aa
Compare
nickolay168
force-pushed
the
nickolay168/better_error_diagnostics
branch
from
September 8, 2026 04:06
01236aa to
531eeaf
Compare
Contributor
Author
|
I have found an issue with the PR.
The question if we need to somehow supopress the error if the user is not authorized on Baidu? After the PR the translation to Lojban will always fail on the ground and on CI/CD unless we have a valid key. |
Green-Sky
approved these changes
Sep 8, 2026
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If Baidu returns an error, we are getting the exception "Failed to translate 'some text' to 'some language': '' ". In this PR I have added the simple code to expose the error message. Below is the example of error, returned from Baidu.
{"errno":995,"errmsg":"request is not authorized","data":null,"logid":"1816048379","extra":"cgKinifGvSXVvMgFRVG88bkl13vdIyraxKRVaS33xbc="}This change is