@@ -77,7 +77,7 @@ public class FileAccess : NSObject {
77
77
try FileManager . default. copyItem ( atPath: source. path ( ) , toPath: target. path ( ) )
78
78
resolve ( nil )
79
79
} catch {
80
- reject ( " ERR " , " Failed to copy ' \( source) ' to ' \( target) '. " , error)
80
+ reject ( " ERR " , " Failed to copy ' \( source) ' to ' \( target) '. \( error . localizedDescription ) " , error)
81
81
}
82
82
}
83
83
}
@@ -94,7 +94,7 @@ public class FileAccess : NSObject {
94
94
try FileManager . default. copyItem ( atPath: assetPath, toPath: target. path ( ) )
95
95
resolve ( nil )
96
96
} catch {
97
- reject ( " ERR " , " Failed to copy ' \( asset) ' to ' \( target) '. " , error)
97
+ reject ( " ERR " , " Failed to copy ' \( asset) ' to ' \( target) '. \( error . localizedDescription ) " , error)
98
98
}
99
99
}
100
100
}
@@ -136,7 +136,7 @@ public class FileAccess : NSObject {
136
136
" internal_total " : stat [ . systemSize]
137
137
] )
138
138
} catch {
139
- reject ( " ERR " , " Failed to stat filesystem. " , error)
139
+ reject ( " ERR " , " Failed to stat filesystem. \( error . localizedDescription ) " , error)
140
140
}
141
141
}
142
142
}
@@ -222,7 +222,7 @@ public class FileAccess : NSObject {
222
222
do {
223
223
try resolve ( FileManager . default. contentsOfDirectory ( atPath: path. path ( ) ) )
224
224
} catch {
225
- reject ( " ERR " , " Failed to list ' \( path) '. " , error)
225
+ reject ( " ERR " , " Failed to list ' \( path) '. \( error . localizedDescription ) " , error)
226
226
}
227
227
}
228
228
}
@@ -234,7 +234,7 @@ public class FileAccess : NSObject {
234
234
try FileManager . default. createDirectory ( atPath: path. path ( ) , withIntermediateDirectories: true , attributes: nil )
235
235
resolve ( path)
236
236
} catch {
237
- reject ( " ERR " , " Failed to create directory ' \( path) '. " , error)
237
+ reject ( " ERR " , " Failed to create directory ' \( path) '. \( error . localizedDescription ) " , error)
238
238
}
239
239
}
240
240
}
@@ -247,7 +247,7 @@ public class FileAccess : NSObject {
247
247
try FileManager . default. moveItem ( atPath: source. path ( ) , toPath: target. path ( ) )
248
248
resolve ( nil )
249
249
} catch {
250
- reject ( " ERR " , " Failed to rename ' \( source) ' to ' \( target) '. " , error)
250
+ reject ( " ERR " , " Failed to rename ' \( source) ' to ' \( target) '. \( error . localizedDescription ) " , error)
251
251
}
252
252
}
253
253
}
@@ -263,7 +263,7 @@ public class FileAccess : NSObject {
263
263
try resolve ( String ( contentsOfFile: path. path ( ) ) )
264
264
}
265
265
} catch {
266
- reject ( " ERR " , " Failed to read ' \( path) '. " , error)
266
+ reject ( " ERR " , " Failed to read ' \( path) '. \( error . localizedDescription ) " , error)
267
267
}
268
268
}
269
269
}
@@ -274,7 +274,7 @@ public class FileAccess : NSObject {
274
274
do {
275
275
resolve ( try self . statFile ( path: path) )
276
276
} catch {
277
- reject ( " ERR " , " Failed to stat ' \( path) '. " , error)
277
+ reject ( " ERR " , " Failed to stat ' \( path) '. \( error . localizedDescription ) " , error)
278
278
}
279
279
}
280
280
}
@@ -288,7 +288,7 @@ public class FileAccess : NSObject {
288
288
. compactMap { try ? self . statFile ( path: base. appendingPathComponent ( $0) . path) }
289
289
)
290
290
} catch {
291
- reject ( " ERR " , " Failed to list ' \( path) '. " , error)
291
+ reject ( " ERR " , " Failed to list ' \( path) '. \( error . localizedDescription ) " , error)
292
292
}
293
293
}
294
294
}
@@ -300,7 +300,7 @@ public class FileAccess : NSObject {
300
300
try FileManager . default. removeItem ( atPath: path. path ( ) )
301
301
resolve ( nil )
302
302
} catch {
303
- reject ( " ERR " , " Failed to unlink ' \( path) '. " , error)
303
+ reject ( " ERR " , " Failed to unlink ' \( path) '. \( error . localizedDescription ) " , error)
304
304
}
305
305
}
306
306
}
@@ -314,7 +314,7 @@ public class FileAccess : NSObject {
314
314
try FileManager . default. unzipItem ( at: sourceUrl, to: targetUrl)
315
315
resolve ( nil )
316
316
} catch {
317
- reject ( " ERR " , " Failed to unzip ' \( source) ' to ' \( target) '. " , error)
317
+ reject ( " ERR " , " Failed to unzip ' \( source) ' to ' \( target) '. \( error . localizedDescription ) " , error)
318
318
}
319
319
}
320
320
}
@@ -335,7 +335,7 @@ public class FileAccess : NSObject {
335
335
}
336
336
resolve ( nil )
337
337
} catch {
338
- reject ( " ERR " , " Failed to write to ' \( path) '. " , error)
338
+ reject ( " ERR " , " Failed to write to ' \( path) '. \( error . localizedDescription ) " , error)
339
339
}
340
340
}
341
341
}
0 commit comments