🎨 Improve importing markdown failed error report https://github.com/siyuan-note/siyuan/issues/8611

This commit is contained in:
Daniel 2023-06-25 09:34:44 +08:00
parent 72d0b6409b
commit de03cdb11c
No known key found for this signature in database
GPG key ID: 86211BA83DF03017

View file

@ -459,6 +459,16 @@ func ImportData(zipPath string) (err error) {
func ImportFromLocalPath(boxID, localPath string, toPath string) (err error) {
util.PushEndlessProgress(Conf.Language(73))
defer func() {
util.PushClearProgress()
if e := recover(); nil != e {
stack := debug.Stack()
msg := fmt.Sprintf("PANIC RECOVERED: %v\n\t%s\n", e, stack)
logging.LogErrorf("import from local path failed: %s", msg)
err = errors.New("import from local path failed, please check kernel log for details")
}
}()
WaitForWritingFiles()