Change ip error

This commit is contained in:
problematicconsumer
2024-02-20 18:49:30 +03:30
parent 874a1af13f
commit c5a4338b41
3 changed files with 17 additions and 5 deletions

View File

@@ -20,6 +20,12 @@ sealed class ProxyFailure with _$ProxyFailure, Failure {
@With<ExpectedFailure>()
const factory ProxyFailure.unknownIp() = UnknownIp;
@With<ExpectedMeasuredFailure>()
const factory ProxyFailure.unableToRetrieveIp([
Object? error,
StackTrace? stackTrace,
]) = UnableToRetrieveIp;
@override
({String type, String? message}) present(TranslationsEn t) {
return switch (this) {
@@ -32,6 +38,10 @@ sealed class ProxyFailure with _$ProxyFailure, Failure {
message: null,
),
UnknownIp() => (type: t.general.unknown, message: null),
UnableToRetrieveIp() => (
type: t.failure.unexpected,
message: null,
),
};
}
}