fix(dictionary): 修复语义映射和错误日志
- 修复语义映射:强制将输入转换为查询语言的对应词 - 移除拼写自动纠正,避免错误纠正(如 franch→franchise) - 修复 winston 日志 Error 对象序列化问题
This commit is contained in:
@@ -21,7 +21,7 @@ export const actionLookUpDictionary = async (dto: ActionInputLookUpDictionary):
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
log.error("Dictionary lookup failed", { error: e });
|
||||
log.error("Dictionary lookup failed", { error: e instanceof Error ? e.message : String(e) });
|
||||
return {
|
||||
success: false,
|
||||
message: 'Unknown error occured.'
|
||||
|
||||
@@ -42,7 +42,7 @@ export const serviceLookUp = async (dto: ServiceInputLookUp) => {
|
||||
},
|
||||
response.entries
|
||||
).catch(error => {
|
||||
log.error("Failed to save dictionary data", { error });
|
||||
log.error("Failed to save dictionary data", { error: error instanceof Error ? error.message : String(error) });
|
||||
});
|
||||
|
||||
return response;
|
||||
@@ -54,7 +54,7 @@ export const serviceLookUp = async (dto: ServiceInputLookUp) => {
|
||||
definitionLang: definitionLang,
|
||||
dictionaryItemId: lastLookUpResult.id
|
||||
}).catch(error => {
|
||||
log.error("Failed to save dictionary data", { error });
|
||||
log.error("Failed to save dictionary data", { error: error instanceof Error ? error.message : String(error) });
|
||||
});
|
||||
return {
|
||||
standardForm: lastLookUpResult.standardForm,
|
||||
|
||||
Reference in New Issue
Block a user