mirror of
https://mirror.ghproxy.com/https://github.com/StarCitizenToolBox/app.git
synced 2024-12-24 00:03:45 +08:00
13 lines
243 B
Dart
13 lines
243 B
Dart
|
import 'package:starcitizen_doctor/common/utils/log.dart';
|
||
|
|
||
|
extension AsyncError on Future {
|
||
|
Future<T?> unwrap<T>() async {
|
||
|
try {
|
||
|
return await this;
|
||
|
} catch (e) {
|
||
|
dPrint("unwrap error:$e");
|
||
|
return null;
|
||
|
}
|
||
|
}
|
||
|
}
|