-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Description
If DeepL detects a language the library doesn't know about, it might respond like this:
{
"translations" : [ {
"text" : "[omitted]",
"detected_source_language" : "CEB",
"tag_handling_version" : "V1"
} ]
}Which causes the following error:
InvalidResponse(
"convert json bytes to Rust type: error decoding response body",
)
The custom error message at
Line 149 in eda1cbf
| format!("invalid language code {lang}. This is an internal issue with the lib, please open issue") |
is missing.
Taking a step back, can the serialization in general be improved to be less prone to errors?
Maybe an unknown language could serialize to something like Lang::UNKNOWN(String)? Or would using an ISO-693 crate be better, to cover all possible codes?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels