mirror of
https://github.com/tubearchivist/browser-extension.git
synced 2025-04-21 10:40:11 +00:00
handle errors from URL constructor
This commit is contained in:
parent
5a59c4c80b
commit
ebb92473d5
@ -44,6 +44,8 @@ document.getElementById('save-login').addEventListener('click', function () {
|
|||||||
if (!url.includes('://')) {
|
if (!url.includes('://')) {
|
||||||
url = 'http://' + url;
|
url = 'http://' + url;
|
||||||
}
|
}
|
||||||
|
try {
|
||||||
|
clearError();
|
||||||
let parsed = new URL(url);
|
let parsed = new URL(url);
|
||||||
let toStore = {
|
let toStore = {
|
||||||
access: {
|
access: {
|
||||||
@ -56,6 +58,9 @@ document.getElementById('save-login').addEventListener('click', function () {
|
|||||||
console.log('Stored connection details: ' + JSON.stringify(toStore));
|
console.log('Stored connection details: ' + JSON.stringify(toStore));
|
||||||
pingBackend();
|
pingBackend();
|
||||||
});
|
});
|
||||||
|
} catch (e) {
|
||||||
|
setError(e.message);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// verify connection status
|
// verify connection status
|
||||||
|
Loading…
Reference in New Issue
Block a user