Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Commit e4a0642

Browse files
authored
[path_provider] Log errors in the linux example (#3146)
1 parent 869f211 commit e4a0642

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

packages/path_provider/path_provider_linux/CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.1.1+2
2+
3+
* Log errors in the example when calls to the `path_provider` fail.
4+
15
## 0.1.1+1
26

37
* Check in linux/ directory for example/
@@ -19,4 +23,3 @@
1923
## 0.0.1
2024
* The initial implementation of path_provider for Linux
2125
* Implements getApplicationSupportPath, getApplicationDocumentsPath, getDownloadsPath, and getTemporaryPath
22-

packages/path_provider/path_provider_linux/example/lib/main.dart

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,25 +35,29 @@ class _MyAppState extends State<MyApp> {
3535
// Platform messages may fail, so we use a try/catch PlatformException.
3636
try {
3737
tempDirectory = (await getTemporaryDirectory()).path;
38-
} on PlatformException {
38+
} on PlatformException catch (e, stackTrace) {
3939
tempDirectory = 'Failed to get temp directory.';
40+
print('$tempDirectory $e $stackTrace');
4041
}
4142
try {
4243
downloadsDirectory = (await getDownloadsDirectory()).path;
43-
} on PlatformException {
44+
} on PlatformException catch (e, stackTrace) {
4445
downloadsDirectory = 'Failed to get downloads directory.';
46+
print('$downloadsDirectory $e $stackTrace');
4547
}
4648

4749
try {
4850
documentsDirectory = (await getApplicationDocumentsDirectory()).path;
49-
} on PlatformException {
51+
} on PlatformException catch (e, stackTrace) {
5052
documentsDirectory = 'Failed to get documents directory.';
53+
print('$documentsDirectory $e $stackTrace');
5154
}
5255

5356
try {
5457
appSupportDirectory = (await getApplicationSupportDirectory()).path;
55-
} on PlatformException {
58+
} on PlatformException catch (e, stackTrace) {
5659
appSupportDirectory = 'Failed to get documents directory.';
60+
print('$appSupportDirectory $e $stackTrace');
5761
}
5862
// If the widget was removed from the tree while the asynchronous platform
5963
// message was in flight, we want to discard the reply rather than calling

packages/path_provider/path_provider_linux/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: path_provider_linux
22
description: linux implementation of the path_provider plugin
3-
version: 0.1.1+1
3+
version: 0.1.1+2
44
homepage: https://github.com/flutter/plugins/tree/master/packages/path_provider/path_provider_linux
55

66
flutter:

0 commit comments

Comments
 (0)