Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
tails
tails
Commits
9093b48a
Commit
9093b48a
authored
Dec 08, 2020
by
sajolida
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Catch error when file is null or undefined
parent
4f79e5fe
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
3 deletions
+21
-3
wiki/src/install/inc/js/download.js
wiki/src/install/inc/js/download.js
+13
-2
wiki/src/install/inc/steps/download.inline.html
wiki/src/install/inc/steps/download.inline.html
+6
-0
wiki/src/install/inc/stylesheets/download.css
wiki/src/install/inc/stylesheets/download.css
+2
-1
No files found.
wiki/src/install/inc/js/download.js
View file @
9093b48a
...
...
@@ -116,6 +116,9 @@ document.addEventListener("DOMContentLoaded", function() {
else
if
(
result
===
"
failed-again
"
)
{
show
(
document
.
getElementById
(
"
verification-failed-again
"
));
}
else
if
(
result
===
"
error-file
"
)
{
show
(
document
.
getElementById
(
"
verification-error-file
"
));
}
else
if
(
result
===
"
error-json
"
)
{
show
(
document
.
getElementById
(
"
verification-error-json
"
));
document
.
getElementById
(
"
checksum-file
"
).
setAttribute
(
"
href
"
,
URLofJsonFileContainingChecksums
);
...
...
@@ -131,6 +134,7 @@ document.addEventListener("DOMContentLoaded", function() {
hide
(
document
.
getElementById
(
"
verification-successful
"
));
hide
(
document
.
getElementById
(
"
verification-failed
"
));
hide
(
document
.
getElementById
(
"
verification-failed-again
"
));
hide
(
document
.
getElementById
(
"
verification-error-file
"
));
hide
(
document
.
getElementById
(
"
verification-error-json
"
));
hide
(
document
.
getElementById
(
"
verification-error-image
"
));
show
(
document
.
getElementById
(
"
verification
"
));
...
...
@@ -147,8 +151,14 @@ document.addEventListener("DOMContentLoaded", function() {
/* Verification logic functions */
async
function
verifyFile
(
e
,
elm
)
{
file
=
elm
.
files
[
0
]
showVerifyingDownload
(
file
.
name
);
try
{
file
=
elm
.
files
[
0
];
showVerifyingDownload
(
file
.
name
);
}
catch
(
err
)
{
showVerificationResult
(
"
error-file
"
);
return
;
}
try
{
var
response
=
await
fetch
(
URLofJsonFileContainingChecksums
);
...
...
@@ -306,5 +316,6 @@ document.addEventListener("DOMContentLoaded", function() {
// showVerificationResult("failed-again");
// showVerificationResult("error-json");
// showVerificationResult("error-image");
// verifyFile(null, null);
});
wiki/src/install/inc/steps/download.inline.html
View file @
9093b48a
...
...
@@ -145,6 +145,12 @@ were solved, and known issues that have already been identified.</p>
</div>
<p>
Please try to download again from a different place or a different computer
…
</p>
</div>
<div
id=
"verification-error-file"
class=
"block"
>
<p>
[[!img lib/cross.png class="icon" link="no" alt=""]]
<b>
Error selecting image.
</b></p>
<p
class=
"usb upgrade download-only-img"
>
Make sure that you select a USB image that is readable by your browser.
</p>
<p
class=
"dvd vm download-only-iso"
>
Make sure that you select an ISO image that is readable by your browser.
</p>
<p><a
id=
"retry-json"
>
Retry
…
</a></p>
</div>
<div
id=
"verification-error-json"
class=
"block"
>
<p>
[[!img lib/cross.png class="icon" link="no" alt=""]]
<b>
Error downloading
<a
id=
"checksum-file"
href=
""
>
checksum file
</a>
from our website.
</b></p>
<p>
Make sure that your browser is connected to the Internet.
</p>
...
...
wiki/src/install/inc/stylesheets/download.css
View file @
9093b48a
...
...
@@ -18,6 +18,7 @@
#verification-successful
,
#verification-failed
,
#verification-failed-again
,
#verification-error-file
,
#verification-error-json
,
#verification-error-image
,
#skip-download
,
...
...
@@ -147,7 +148,7 @@ img.icon {
vertical-align
:
bottom
;
}
#verification-error-json
,
#verification-error-image
{
#verification-error-file
,
#verification-error-json
,
#verification-error-image
{
margin-top
:
1.5em
;
}
...
...
sajolida
@sajolida
mentioned in issue
#16128 (closed)
·
Dec 08, 2020
mentioned in issue
#16128 (closed)
mentioned in issue #16128
Toggle commit list
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment