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,10 +21,16 @@
|
|||
div.appendChild(document.createTextNode(event.message));
|
||||
msg.appendChild(div);
|
||||
|
||||
if (event.filename !== undefined && event.lineno !== undefined && event.colno !== undefined) {
|
||||
if (event.filename) {
|
||||
div = document.createElement("div");
|
||||
div.className = 'noVNC_location';
|
||||
const text = event.filename + ":" + event.lineno + ":" + event.colno;
|
||||
var text = event.filename;
|
||||
if (event.lineno !== undefined) {
|
||||
text += ":" + event.lineno;
|
||||
if (event.colno !== undefined) {
|
||||
text += ":" + event.colno;
|
||||
}
|
||||
}
|
||||
div.appendChild(document.createTextNode(text));
|
||||
msg.appendChild(div);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue