fix: Prefer reusing AppBaseException instead of redefining the exception contract CacheException and RemoteException

This commit is contained in:
dab246
2026-03-09 10:27:16 +07:00
committed by Dat H. Pham
parent 236ad5f075
commit 8a21e35d1e
139 changed files with 344 additions and 325 deletions
@@ -0,0 +1,26 @@
import 'package:core/domain/exceptions/app_base_exception.dart';
abstract class RemoteException extends AppBaseException {
final int? code;
const RemoteException({
this.code,
String? message,
}) : super(message);
@override
String toString() {
if (code != null && message != null) {
return '$exceptionName(code: $code): $message';
}
if (code != null) {
return '$exceptionName(code: $code)';
}
return super.toString();
}
@override
List<Object?> get props => [code, ...super.props];
}