exception_ext.dart 374 Bytes
import 'package:wow_english/common/request/exception.dart';

extension ExceptionExtension on Exception {
  String get getShowMessage {
    if (this is ApiException) {
      return (this as ApiException).message ?? '未知错误';
    } else if (this is FormatException) {
      return (this as FormatException).message;
    } else {
      return '未知错误';
    }
  }
}