11// Copyright 2013 The Flutter Authors. All rights reserved.
22// Use of this source code is governed by a BSD-style license that can be
33// found in the LICENSE file.
4- // Autogenerated from Pigeon (v5.0 .1), do not edit directly.
4+ // Autogenerated from Pigeon (v9.1 .1), do not edit directly.
55// See also: https://pub.dev/packages/pigeon
66
77import Foundation
@@ -14,7 +14,25 @@ import FlutterMacOS
1414#endif
1515
1616
17- /// Generated class from Pigeon.
17+
18+ private func wrapResult( _ result: Any ? ) -> [ Any ? ] {
19+ return [ result]
20+ }
21+
22+ private func wrapError( _ error: Any ) -> [ Any ? ] {
23+ if let flutterError = error as? FlutterError {
24+ return [
25+ flutterError. code,
26+ flutterError. message,
27+ flutterError. details
28+ ]
29+ }
30+ return [
31+ " \( error) " ,
32+ " \( type ( of: error) ) " ,
33+ " Stacktrace: \( Thread . callStackSymbols) "
34+ ]
35+ }
1836
1937enum DirectoryType : Int {
2038 case applicationDocuments = 0
@@ -25,8 +43,8 @@ enum DirectoryType: Int {
2543}
2644/// Generated protocol from Pigeon that represents a handler of messages from Flutter.
2745protocol PathProviderApi {
28- func getDirectoryPath( type: DirectoryType ) -> String ?
29- func getContainerPath( appGroupIdentifier: String ) -> String ?
46+ func getDirectoryPath( type: DirectoryType ) throws -> String ?
47+ func getContainerPath( appGroupIdentifier: String ) throws -> String ?
3048}
3149
3250/// Generated setup class from Pigeon to handle messages through the `binaryMessenger`.
@@ -37,36 +55,32 @@ class PathProviderApiSetup {
3755 let getDirectoryPathChannel = FlutterBasicMessageChannel ( name: " dev.flutter.pigeon.PathProviderApi.getDirectoryPath " , binaryMessenger: binaryMessenger)
3856 if let api = api {
3957 getDirectoryPathChannel. setMessageHandler { message, reply in
40- let args = message as! [ Any ? ]
58+ let args = message as! [ Any ]
4159 let typeArg = DirectoryType ( rawValue: args [ 0 ] as! Int ) !
42- let result = api. getDirectoryPath ( type: typeArg)
43- reply ( wrapResult ( result) )
60+ do {
61+ let result = try api. getDirectoryPath ( type: typeArg)
62+ reply ( wrapResult ( result) )
63+ } catch {
64+ reply ( wrapError ( error) )
65+ }
4466 }
4567 } else {
4668 getDirectoryPathChannel. setMessageHandler ( nil )
4769 }
4870 let getContainerPathChannel = FlutterBasicMessageChannel ( name: " dev.flutter.pigeon.PathProviderApi.getContainerPath " , binaryMessenger: binaryMessenger)
4971 if let api = api {
5072 getContainerPathChannel. setMessageHandler { message, reply in
51- let args = message as! [ Any ? ]
73+ let args = message as! [ Any ]
5274 let appGroupIdentifierArg = args [ 0 ] as! String
53- let result = api. getContainerPath ( appGroupIdentifier: appGroupIdentifierArg)
54- reply ( wrapResult ( result) )
75+ do {
76+ let result = try api. getContainerPath ( appGroupIdentifier: appGroupIdentifierArg)
77+ reply ( wrapResult ( result) )
78+ } catch {
79+ reply ( wrapError ( error) )
80+ }
5581 }
5682 } else {
5783 getContainerPathChannel. setMessageHandler ( nil )
5884 }
5985 }
6086}
61-
62- private func wrapResult( _ result: Any ? ) -> [ Any ? ] {
63- return [ result]
64- }
65-
66- private func wrapError( _ error: FlutterError ) -> [ Any ? ] {
67- return [
68- error. code,
69- error. message,
70- error. details
71- ]
72- }
0 commit comments