Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RWA.Support.WebApp
Manage
Activity
Members
Labels
Plan
Issues
5
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
RemoteWebApp
RWA.Support.WebApp
Merge requests
!14
Improve noVNC integration
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Improve noVNC integration
feature/improve-novnc-integration
into
master
Overview
0
Commits
4
Pipelines
1
Changes
7
Merged
Jonathan Weth
requested to merge
feature/improve-novnc-integration
into
master
3 years ago
Overview
0
Commits
4
Pipelines
1
Changes
7
Expand
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
3274a4b8
4 commits,
3 years ago
7 files
+
398
−
1572
Expand all files
Preferences
File browser
List view
Tree view
Compare changes
Inline
Side-by-side
Show whitespace changes
Show one file at a time
Some changes are not shown
For a faster browsing experience, some files are collapsed by default.
Expand all files
Search (e.g. *.vue) (Ctrl+P)
aleksis/apps/rwasupport/static/rwasupport/viewers/vnc/error-handler.js deleted
100644 → 0
+
0
−
66
Options
/*
* noVNC: HTML5 VNC client
* Copyright (C) 2019 The noVNC Authors
* Licensed under MPL 2.0 (see LICENSE.txt)
*
* See README.md for usage and integration instructions.
*/
// NB: this should *not* be included as a module until we have
// native support in the browsers, so that our error handler
// can catch script-loading errors.
// No ES6 can be used in this file since it's used for the translation
/* eslint-disable prefer-arrow-callback */
(
function
_scope
()
{
"
use strict
"
;
// Fallback for all uncought errors
function
handleError
(
event
,
err
)
{
try
{
const
msg
=
document
.
getElementById
(
'
noVNC_fallback_errormsg
'
);
// Only show the initial error
if
(
msg
.
hasChildNodes
())
{
return
false
;
}
let
div
=
document
.
createElement
(
"
div
"
);
div
.
classList
.
add
(
'
noVNC_message
'
);
div
.
appendChild
(
document
.
createTextNode
(
event
.
message
));
msg
.
appendChild
(
div
);
if
(
event
.
filename
)
{
div
=
document
.
createElement
(
"
div
"
);
div
.
className
=
'
noVNC_location
'
;
let
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
);
}
if
(
err
&&
err
.
stack
)
{
div
=
document
.
createElement
(
"
div
"
);
div
.
className
=
'
noVNC_stack
'
;
div
.
appendChild
(
document
.
createTextNode
(
err
.
stack
));
msg
.
appendChild
(
div
);
}
document
.
getElementById
(
'
noVNC_fallback_error
'
)
.
classList
.
add
(
"
noVNC_open
"
);
}
catch
(
exc
)
{
document
.
write
(
"
noVNC encountered an error.
"
);
}
// Don't return true since this would prevent the error
// from being printed to the browser console.
return
false
;
}
window
.
addEventListener
(
'
error
'
,
function
onerror
(
evt
)
{
handleError
(
evt
,
evt
.
error
);
});
window
.
addEventListener
(
'
unhandledrejection
'
,
function
onreject
(
evt
)
{
handleError
(
evt
.
reason
,
evt
.
reason
);
});
})();