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
76bc4625
Unverified
Commit
76bc4625
authored
Apr 07, 2021
by
Christopher Fujino
Committed by
GitHub
Apr 07, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
migrate empty exceptions to tool exit with error message (#79898)
parent
15b9b58e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
9 deletions
+7
-9
gen_l10n.dart
packages/flutter_tools/lib/src/localizations/gen_l10n.dart
+3
-4
localizations_test.dart
...eneral.shard/build_system/targets/localizations_test.dart
+4
-5
No files found.
packages/flutter_tools/lib/src/localizations/gen_l10n.dart
View file @
76bc4625
...
...
@@ -6,6 +6,7 @@
import
'package:meta/meta.dart'
;
import
'../base/common.dart'
;
import
'../base/file_system.dart'
;
import
'../base/logger.dart'
;
import
'../convert.dart'
;
...
...
@@ -32,7 +33,7 @@ void generateLocalizations({
logger:
logger
,
);
if
(
options
.
useSyntheticPackage
&&
!
flutterManifest
.
generateSyntheticPackage
)
{
logger
.
printError
(
throwToolExit
(
'Attempted to generate localizations code without having '
'the flutter: generate flag turned on.'
'
\n
'
...
...
@@ -40,7 +41,6 @@ void generateLocalizations({
'been added and rebuild the project. Otherwise, the localizations '
'source code will not be importable.'
);
throw
Exception
();
}
precacheLanguageAndRegionTags
();
...
...
@@ -71,8 +71,7 @@ void generateLocalizations({
..
loadResources
()
..
writeOutputFiles
(
logger
,
isFromYaml:
true
);
}
on
L10nException
catch
(
e
)
{
logger
.
printError
(
e
.
message
);
throw
Exception
();
throwToolExit
(
e
.
message
);
}
}
...
...
packages/flutter_tools/test/general.shard/build_system/targets/localizations_test.dart
View file @
76bc4625
...
...
@@ -115,11 +115,10 @@ flutter:
projectDir:
fileSystem
.
currentDirectory
,
dependenciesDir:
fileSystem
.
currentDirectory
,
),
throwsA
(
isA
<
Exception
>()),
);
expect
(
logger
.
errorText
,
contains
(
'Attempted to generate localizations code without having the flutter: generate flag turned on.'
),
throwsToolExit
(
message:
'Attempted to generate localizations code without having the '
'flutter: generate flag turned on.'
,
),
);
});
...
...
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