Unverified Commit 8d0af367 authored by Alex Li's avatar Alex Li Committed by GitHub

πŸ₯… 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
parent 6f9a896d
...@@ -520,7 +520,7 @@ class Cache { ...@@ -520,7 +520,7 @@ class Cache {
if (_hasWarnedAboutStorageOverride) { if (_hasWarnedAboutStorageOverride) {
return; return;
} }
_logger.printError( _logger.printWarning(
'Flutter assets will be downloaded from $overrideUrl. Make sure you trust this source!', 'Flutter assets will be downloaded from $overrideUrl. Make sure you trust this source!',
emphasis: true, emphasis: true,
); );
......
...@@ -319,7 +319,7 @@ void main() { ...@@ -319,7 +319,7 @@ void main() {
expect(() => cache.storageBaseUrl, throwsToolExit()); 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(); final BufferLogger logger = BufferLogger.test();
const String baseUrl = 'https://storage.com'; const String baseUrl = 'https://storage.com';
final Cache cache = Cache.test( final Cache cache = Cache.test(
...@@ -331,7 +331,7 @@ void main() { ...@@ -331,7 +331,7 @@ void main() {
); );
expect(cache.storageBaseUrl, baseUrl); 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); expect(logger.statusText, isEmpty);
}); });
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment