fix: error handling
This commit is contained in:
parent
f1412cdffa
commit
baf187ee46
|
@ -14,6 +14,7 @@ const TYPE_REG = /id=(\d+)&type=(img|mp3|midi)/
|
||||||
const magicHookConstr = (() => {
|
const magicHookConstr = (() => {
|
||||||
const l = {}
|
const l = {}
|
||||||
|
|
||||||
|
try {
|
||||||
hookNative(document.body, 'append', (fn) => {
|
hookNative(document.body, 'append', (fn) => {
|
||||||
return function (...nodes: Node[]) {
|
return function (...nodes: Node[]) {
|
||||||
fn.call(this, ...nodes)
|
fn.call(this, ...nodes)
|
||||||
|
@ -39,6 +40,9 @@ const magicHookConstr = (() => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
} catch (err) {
|
||||||
|
console.error(err)
|
||||||
|
}
|
||||||
|
|
||||||
return async (type: FileType) => {
|
return async (type: FileType) => {
|
||||||
return new Promise<string>((resolve) => {
|
return new Promise<string>((resolve) => {
|
||||||
|
|
Loading…
Reference in New Issue