abstract class Failure {
  final String message;
  const Failure(this.message);

  @override
  String toString() => message;
}

class ServerFailure extends Failure {
  final int? statusCode;
  const ServerFailure(super.message, {this.statusCode});
}

class NetworkFailure extends Failure {
  const NetworkFailure([super.message = '网络连接失败，请检查网络设置']);
}

class TimeoutFailure extends Failure {
  const TimeoutFailure([super.message = '连接超时，请稍后重试']);
}

class CacheFailure extends Failure {
  const CacheFailure([super.message = '本地缓存读写失败']);
}

class AuthFailure extends Failure {
  const AuthFailure([super.message = '登录已过期，请重新登录']);
}
