cmd/trace: fix a javascript bug in handling import error

When traceviewer encounters a failure of json trace import
due to data error, onImportFail tried to access an error variable
which was not yet defined.

Change-Id: I431be03f179aafacaf1fd3c62a6337e8b5bd18fb
Reviewed-on: https://go-review.googlesource.com/71970
Reviewed-by: Austin Clements <austin@google.com>
This commit is contained in:
Hana Kim 2017-10-19 17:47:07 -04:00 committed by Hyang-Ah Hana Kim
parent 916ad62d51
commit 2f40dc79e5
1 changed files with 1 additions and 1 deletions

View File

@ -114,7 +114,7 @@ var templTrace = `
viewer.viewTitle = "trace";
}
function onImportFail() {
function onImportFail(err) {
var overlay = new tr.ui.b.Overlay();
overlay.textContent = tr.b.normalizeException(err).message;
overlay.title = 'Import error';