diff options
author | Maxim Devaev <[email protected]> | 2024-09-18 04:37:43 +0300 |
---|---|---|
committer | Maxim Devaev <[email protected]> | 2024-09-18 04:37:43 +0300 |
commit | 7a53f1445619fc471c2823e7081de8b6039b938e (patch) | |
tree | 961dd0072cc976504fe4570743d801c79512e9a6 /web | |
parent | 45270a09d7b5076bac96887a1e36d752882e3adf (diff) |
refactoring
Diffstat (limited to 'web')
-rw-r--r-- | web/share/js/kvm/msd.js | 4 | ||||
-rw-r--r-- | web/share/js/kvm/recorder.js | 4 | ||||
-rw-r--r-- | web/share/js/kvm/session.js | 4 | ||||
-rw-r--r-- | web/share/js/kvm/stream_janus.js | 4 | ||||
-rw-r--r-- | web/share/js/wm.js | 18 |
5 files changed, 17 insertions, 17 deletions
diff --git a/web/share/js/kvm/msd.js b/web/share/js/kvm/msd.js index 356e39f6..662c04e4 100644 --- a/web/share/js/kvm/msd.js +++ b/web/share/js/kvm/msd.js @@ -141,8 +141,8 @@ export function Msd() { if (!result.ok) { msg = `Can't upload image to the Mass Storage Drive:<br>${result_str}`; } - } catch (err) { - msg = `Can't parse upload result:<br>${err}`; + } catch (ex) { + msg = `Can't parse upload result:<br>${ex}`; } if (msg.length > 0) { wm.error(msg); diff --git a/web/share/js/kvm/recorder.js b/web/share/js/kvm/recorder.js index 1ed340ec..03ec39b5 100644 --- a/web/share/js/kvm/recorder.js +++ b/web/share/js/kvm/recorder.js @@ -214,8 +214,8 @@ export function Recorder() { __events = events; __events_time = events_time; - } catch (err) { - wm.error(`Invalid script: ${err}`); + } catch (ex) { + wm.error(`Invalid script: ${ex}`); } el_input.value = ""; diff --git a/web/share/js/kvm/session.js b/web/share/js/kvm/session.js index a183b33e..98070927 100644 --- a/web/share/js/kvm/session.js +++ b/web/share/js/kvm/session.js @@ -411,8 +411,8 @@ export function Session() { throw new Error("Too many missed heartbeats"); } __ws.send("{\"event_type\": \"ping\", \"event\": {}}"); - } catch (err) { - __wsErrorHandler(err.message); + } catch (ex) { + __wsErrorHandler(ex.message); } }; diff --git a/web/share/js/kvm/stream_janus.js b/web/share/js/kvm/stream_janus.js index 0400267b..be62dbbd 100644 --- a/web/share/js/kvm/stream_janus.js +++ b/web/share/js/kvm/stream_janus.js @@ -435,8 +435,8 @@ JanusStreamer.ensure_janus = function(callback) { callback(true); }, }); - }).catch((err) => { - tools.error("Stream: Can't import Janus module:", err); + }).catch((ex) => { + tools.error("Stream: Can't import Janus module:", ex); callback(false); }); } else { diff --git a/web/share/js/wm.js b/web/share/js/wm.js index 11f65faa..6a26a648 100644 --- a/web/share/js/wm.js +++ b/web/share/js/wm.js @@ -145,10 +145,10 @@ function __WindowManager() { /************************************************************************/ self.copyTextToClipboard = function(text) { - let workaround = function(err) { + let workaround = function(ex) { // https://stackoverflow.com/questions/60317969/document-execcommandcopy-not-working-even-though-the-dom-element-is-created let callback = function() { - tools.error("copyTextToClipboard(): navigator.clipboard.writeText() is not working:", err); + tools.error("copyTextToClipboard(): navigator.clipboard.writeText() is not working:", ex); tools.info("copyTextToClipboard(): Trying a workaround..."); let el = document.createElement("textarea"); @@ -164,16 +164,16 @@ function __WindowManager() { el.setSelectionRange(0, el.value.length); // iOS try { - err = (document.execCommand("copy") ? null : "Unknown error"); - } catch (err) { // eslint-disable-line no-unused-vars + ex = (document.execCommand("copy") ? null : "Unknown error"); + } catch (ex) { // eslint-disable-line no-unused-vars } // Remove the added textarea again: document.body.removeChild(el); - if (err) { - tools.error("copyTextToClipboard(): Workaround failed:", err); - wm.error("Can't copy text to the clipboard:<br>", err); + if (ex) { + tools.error("copyTextToClipboard(): Workaround failed:", ex); + wm.error("Can't copy text to the clipboard:<br>", ex); } }; __modalDialog("Info", "Press OK to copy the text to the clipboard", true, false, callback); @@ -181,8 +181,8 @@ function __WindowManager() { if (navigator.clipboard) { navigator.clipboard.writeText(text).then(function() { wm.info("The text has been copied to the clipboard"); - }, function(err) { - workaround(err); + }, function(ex) { + workaround(ex); }); } else { workaround("navigator.clipboard is not available"); |