Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #72 - Adding try/catch for errors in parsing plot config element #96

Merged
merged 1 commit into from
Nov 8, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion ait/gui/static/js/ait/gui/Plot.js
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,16 @@ const Plot =
*/
processTag (vnode) {
if (vnode.tag === 'ait-plotconfig') {
this._backend.handleOptionsOverride(this._options, JSON.parse(vnode.text))
try {
this._backend.handleOptionsOverride(this._options, JSON.parse(vnode.text))
}
catch(error) {
if (error instanceof SyntaxError) {
console.error('Error parsing plot config. Printing trace back ' +
'and reverting to default options.')
}
console.error(error)
}
}
else if (vnode.tag === 'ait-plotseries') {
this.processTagSeries(vnode)
Expand Down