Fix mermaid error handling

This commit is contained in:
Sheogorath 2017-10-30 11:44:40 +01:00
parent b3c66d4a10
commit e807f1b783
No known key found for this signature in database
GPG key ID: 1F05CC3635CDDFFD

View file

@ -378,9 +378,14 @@ export function finishView (view) {
$ele.html($value.text()) $ele.html($value.text())
window.mermaid.init(undefined, $ele) window.mermaid.init(undefined, $ele)
} catch (err) { } catch (err) {
var errormessage = err
if (err.str) {
errormessage = err.str
}
$value.unwrap() $value.unwrap()
$value.parent().append('<div class="alert alert-warning">' + err + '</div>') $value.parent().append('<div class="alert alert-warning">' + errormessage + '</div>')
console.warn(err) console.warn(errormessage)
} }
}) })
// abc.js // abc.js