mirror of
https://github.com/dromara/RuoYi-Vue-Plus.git
synced 2025-10-19 00:13:42 +08:00
fix 修复 翻译时异常导致json序列化结构体不符合预期
This commit is contained in:
@@ -46,8 +46,14 @@ public class TranslationHandler extends JsonSerializer<Object> implements Contex
|
|||||||
gen.writeNull();
|
gen.writeNull();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
try {
|
||||||
Object result = trans.translation(value, translation.other());
|
Object result = trans.translation(value, translation.other());
|
||||||
gen.writeObject(result);
|
gen.writeObject(result);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("翻译处理异常,type: {}, value: {}", translation.type(), value, e);
|
||||||
|
// 出现异常时输出原始值而不是中断序列化
|
||||||
|
gen.writeObject(value);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
gen.writeObject(value);
|
gen.writeObject(value);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user