🥅 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:
@@ -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,
|
||||
);
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user