chore: sync and leave bug to be fixed

This commit is contained in:
JuanZoran
2023-03-12 09:56:31 +08:00
parent cdb1ab847a
commit 27ef2c00b0
9 changed files with 132 additions and 83 deletions

View File

@@ -1,6 +1,5 @@
local M = {}
local baidu = require('Trans').conf.engines.baidu
local app_id = baidu.app_id
local app_passwd = baidu.app_passwd

View File

@@ -1,7 +1,9 @@
return setmetatable({}, {
__index = function(t, k)
local res, engine = pcall(require, [[Trans.backend.]] .. k)
assert(res, [[No such Backend: ]] .. k)
if not res then
error([[Fail to load backend: ]] .. k .. '\n ' .. engine)
end
t[k] = engine
return engine
end