🥅 Produce warning instead of error for storage base url overrides (#119595)

* 🥅 Only log warning for storage base url

* ✅ Add test

* ✅ Add the link to the test

* ✅ Remove the test

* ✅ Remove the extra import
This commit is contained in:
Alex Li
2023-02-01 11:49:31 +08:00
committed by GitHub
parent 6f9a896d79
commit 8d0af36798
2 changed files with 3 additions and 3 deletions

View File

@@ -520,7 +520,7 @@ class Cache {
if (_hasWarnedAboutStorageOverride) {
return;
}
_logger.printError(
_logger.printWarning(
'Flutter assets will be downloaded from $overrideUrl. Make sure you trust this source!',
emphasis: true,
);

View File

@@ -319,7 +319,7 @@ void main() {
expect(() => cache.storageBaseUrl, throwsToolExit());
});
testWithoutContext('overridden storage base url prints warning to STDERR', () async {
testWithoutContext('overridden storage base url prints warning', () async {
final BufferLogger logger = BufferLogger.test();
const String baseUrl = 'https://storage.com';
final Cache cache = Cache.test(
@@ -331,7 +331,7 @@ void main() {
);
expect(cache.storageBaseUrl, baseUrl);
expect(logger.errorText, contains('Flutter assets will be downloaded from $baseUrl'));
expect(logger.warningText, contains('Flutter assets will be downloaded from $baseUrl'));
expect(logger.statusText, isEmpty);
});
});