import 'package:equatable/equatable.dart';

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

  @override
  List<Object> get props => [message];
}

class ServerFailure extends Failure {
  const ServerFailure([super.message = '服务器错误']);
}

class NetworkFailure extends Failure {
  const NetworkFailure([super.message = '网络连接失败']);
}

class CacheFailure extends Failure {
  const CacheFailure([super.message = '缓存错误']);
}

class AuthFailure extends Failure {
  const AuthFailure([super.message = '认证失败']);
}

class WalletFailure extends Failure {
  const WalletFailure([super.message = '钱包操作失败']);
}

class BlockchainFailure extends Failure {
  const BlockchainFailure([super.message = '区块链交互失败']);
}

class ValidationFailure extends Failure {
  const ValidationFailure([super.message = '验证失败']);
}

class StorageFailure extends Failure {
  const StorageFailure([super.message = '存储操作失败']);
}
