Handle partial error location information
We might not get line or column number, but the file is still useful information.
This commit is contained in:
parent
5da03103a3
commit
732233eda0
|
@ -21,11 +21,17 @@
|
||||||
div.appendChild(document.createTextNode(event.message));
|
div.appendChild(document.createTextNode(event.message));
|
||||||
msg.appendChild(div);
|
msg.appendChild(div);
|
||||||
|
|
||||||
if (event.filename !== undefined && event.lineno !== undefined && event.colno !== undefined) {
|
if (event.filename) {
|
||||||
div = document.createElement("div");
|
div = document.createElement("div");
|
||||||
div.className = 'noVNC_location';
|
div.className = 'noVNC_location';
|
||||||
const text = event.filename + ":" + event.lineno + ":" + event.colno;
|
var text = event.filename;
|
||||||
div.appendChild(document.createTextNode(text));
|
if (event.lineno !== undefined) {
|
||||||
|
text += ":" + event.lineno;
|
||||||
|
if (event.colno !== undefined) {
|
||||||
|
text += ":" + event.colno;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
div.appendChild(document.createTextNode(text));
|
||||||
msg.appendChild(div);
|
msg.appendChild(div);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue