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
25dd8684
Unverified
Commit
25dd8684
authored
Jan 08, 2021
by
Jonah Williams
Committed by
GitHub
Jan 08, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[flutter_tools] add 483 to non-recoverable errors (#73579)
parent
df981455
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
0 deletions
+31
-0
error_handling_io.dart
packages/flutter_tools/lib/src/base/error_handling_io.dart
+7
-0
error_handling_io_test.dart
...tools/test/general.shard/base/error_handling_io_test.dart
+24
-0
No files found.
packages/flutter_tools/lib/src/base/error_handling_io.dart
View file @
25dd8684
...
...
@@ -692,6 +692,8 @@ void _handleWindowsException(Exception e, String message, int errorCode) {
const
int
kDeviceFull
=
112
;
const
int
kUserMappedSectionOpened
=
1224
;
const
int
kAccessDenied
=
5
;
const
int
kFatalDeviceHardwareError
=
483
;
// Catch errors and bail when:
String
errorMessage
;
switch
(
errorCode
)
{
...
...
@@ -714,6 +716,11 @@ void _handleWindowsException(Exception e, String message, int errorCode) {
'Do you have an antivirus program running? '
'Try disabling your antivirus program and try again.'
;
break
;
case
kFatalDeviceHardwareError:
errorMessage
=
'
$message
. There is a problem with the device driver '
'that this file or directory is stored on.'
;
break
;
default
:
// Caller must rethrow the exception.
break
;
...
...
packages/flutter_tools/test/general.shard/base/error_handling_io_test.dart
View file @
25dd8684
...
...
@@ -173,6 +173,7 @@ void main() {
const
int
kDeviceFull
=
112
;
const
int
kUserMappedSectionOpened
=
1224
;
const
int
kUserPermissionDenied
=
5
;
const
int
kFatalDeviceHardwareError
=
483
;
MockFileSystem
mockFileSystem
;
ErrorHandlingFileSystem
fs
;
...
...
@@ -271,6 +272,29 @@ void main() {
throwsToolExit
(
message:
expectedMessage
));
});
testWithoutContext
(
'when the device driver has a fatal error'
,
()
async
{
setupWriteMocks
(
mockFileSystem:
mockFileSystem
,
fs:
fs
,
errorCode:
kFatalDeviceHardwareError
,
);
final
File
file
=
fs
.
file
(
'file'
);
const
String
expectedMessage
=
'There is a problem with the device driver '
'that this file or directory is stored on'
;
expect
(()
async
=>
await
file
.
writeAsBytes
(<
int
>[
0
]),
throwsToolExit
(
message:
expectedMessage
));
expect
(()
async
=>
await
file
.
writeAsString
(
''
),
throwsToolExit
(
message:
expectedMessage
));
expect
(()
=>
file
.
writeAsBytesSync
(<
int
>[
0
]),
throwsToolExit
(
message:
expectedMessage
));
expect
(()
=>
file
.
writeAsStringSync
(
''
),
throwsToolExit
(
message:
expectedMessage
));
expect
(()
=>
file
.
openSync
(),
throwsToolExit
(
message:
expectedMessage
));
});
testWithoutContext
(
'when creating a temporary dir on a full device'
,
()
async
{
setupDirectoryMocks
(
mockFileSystem:
mockFileSystem
,
...
...
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