Skip to content

Commit

Permalink
Merge pull request #96 from NASA-AMMOS/issue-72
Browse files Browse the repository at this point in the history
Issue #72 - Adding try/catch for errors in parsing plot config element
  • Loading branch information
jordanpadams authored Nov 8, 2018
2 parents 72a34ab + f2fa6bf commit abf323c
Showing 1 changed file with 10 additions and 1 deletion.
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

0 comments on commit abf323c

Please sign in to comment.