This is an automated email from the ASF dual-hosted git repository.
solomax pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/openmeetings.git
The following commit(s) were added to refs/heads/master by this push:
new 0991077 [OPENMEETINGS-2000] math: better error handling
0991077 is described below
commit 099107720345a761c08d6788c1ffa787b72aba83
Author: Maxim Solodovnik <[email protected]>
AuthorDate: Sun Dec 27 10:09:54 2020 +0700
[OPENMEETINGS-2000] math: better error handling
---
openmeetings-web/src/main/front/wb/src/wb-tool-stat-math.js | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/openmeetings-web/src/main/front/wb/src/wb-tool-stat-math.js
b/openmeetings-web/src/main/front/wb/src/wb-tool-stat-math.js
index 15e2c5c..42aaee4 100644
--- a/openmeetings-web/src/main/front/wb/src/wb-tool-stat-math.js
+++ b/openmeetings-web/src/main/front/wb/src/wb-tool-stat-math.js
@@ -13,6 +13,9 @@ MathJax = {
, background: ''
, size: ''
}
+ , formatError(_, error) {
+ throw error;
+ }
}
, svg: {
fontCache: 'local'
@@ -51,14 +54,9 @@ function _tex2svg(tex, callback, _errCallback) {
, ex: 8 // ex-size in pixels
, containerWidth: 80 * 16
}).then(function (node) {
- const errEl = node.querySelector('[data-mjx-error]');
- if (errEl) {
- _errCallback(errEl.getAttribute('data-mjx-error'));
- } else {
- callback(node.firstElementChild);
- }
+ callback(node.firstElementChild);
}).catch(function (err) {
- console.error(err);
+ _errCallback(err.message);
});
}
function create(o, canvas, callback, errCallback) {