Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
851ff687
Unverified
Commit
851ff687
authored
Jan 20, 2021
by
Jonah Williams
Committed by
GitHub
Jan 20, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[flutter_tools] throwToolExit from archive failure (#74259)
parent
80142d45
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
6 deletions
+11
-6
cache.dart
packages/flutter_tools/lib/src/cache.dart
+6
-2
artifact_updater_test.dart
...utter_tools/test/general.shard/artifact_updater_test.dart
+5
-4
No files found.
packages/flutter_tools/lib/src/cache.dart
View file @
851ff687
...
...
@@ -1793,10 +1793,14 @@ class ArtifactUpdater {
try
{
extractor
(
tempFile
,
location
);
}
on
Exception
{
}
on
Exception
catch
(
err
)
{
retries
-=
1
;
if
(
retries
==
0
)
{
rethrow
;
throwToolExit
(
'Flutter could not download and/or extract
$url
. Ensure you have '
'network connectivity and all of the required dependencies listed at'
'flutter.dev/setup.
\n
The original exception was:
$err
.'
);
}
_deleteIgnoringErrors
(
tempFile
);
continue
;
...
...
packages/flutter_tools/test/general.shard/artifact_updater_test.dart
View file @
851ff687
...
...
@@ -5,6 +5,7 @@
import
'package:file/memory.dart'
;
import
'package:file/src/interface/file.dart'
;
import
'package:file_testing/file_testing.dart'
;
import
'package:flutter_tools/src/base/common.dart'
;
import
'package:flutter_tools/src/base/file_system.dart'
;
import
'package:flutter_tools/src/base/io.dart'
;
import
'package:flutter_tools/src/base/logger.dart'
;
...
...
@@ -246,7 +247,7 @@ void main() {
expect
(
fileSystem
.
file
(
'out/test'
),
isNot
(
exists
));
});
testWithoutContext
(
'ArtifactUpdater will
d
e-download a file if unzipping fails'
,
()
async
{
testWithoutContext
(
'ArtifactUpdater will
r
e-download a file if unzipping fails'
,
()
async
{
final
MockOperatingSystemUtils
operatingSystemUtils
=
MockOperatingSystemUtils
();
final
MemoryFileSystem
fileSystem
=
MemoryFileSystem
.
test
();
final
BufferLogger
logger
=
BufferLogger
.
test
();
...
...
@@ -294,7 +295,7 @@ void main() {
expect
(
fileSystem
.
file
(
'out/test'
),
exists
);
});
testWithoutContext
(
'ArtifactUpdater will bail if unzipping fails more than twice'
,
()
async
{
testWithoutContext
(
'ArtifactUpdater will bail
with a tool exit
if unzipping fails more than twice'
,
()
async
{
final
MockOperatingSystemUtils
operatingSystemUtils
=
MockOperatingSystemUtils
();
final
MemoryFileSystem
fileSystem
=
MemoryFileSystem
.
test
();
final
BufferLogger
logger
=
BufferLogger
.
test
();
...
...
@@ -313,7 +314,7 @@ void main() {
'test message'
,
Uri
.
parse
(
'http:///test.zip'
),
fileSystem
.
currentDirectory
.
childDirectory
(
'out'
),
),
throwsA
(
isA
<
Exception
>()));
),
throwsA
(
isA
<
ToolExit
>()));
expect
(
fileSystem
.
file
(
'te,[/test'
),
isNot
(
exists
));
expect
(
fileSystem
.
file
(
'out/test'
),
isNot
(
exists
));
});
...
...
@@ -337,7 +338,7 @@ void main() {
'test message'
,
Uri
.
parse
(
'http:///test.zip'
),
fileSystem
.
currentDirectory
.
childDirectory
(
'out'
),
),
throwsA
(
isA
<
Exception
>()));
),
throwsA
(
isA
<
ToolExit
>()));
expect
(
fileSystem
.
file
(
'te,[/test'
),
isNot
(
exists
));
expect
(
fileSystem
.
file
(
'out/test'
),
isNot
(
exists
));
});
...
...
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