2023-11-28 18:24:31 +03:30
|
|
|
import 'package:freezed_annotation/freezed_annotation.dart';
|
2026-01-17 13:09:20 +03:00
|
|
|
import 'package:umbrix/core/localization/translations.dart';
|
|
|
|
|
import 'package:umbrix/core/model/failures.dart';
|
2023-11-28 18:24:31 +03:30
|
|
|
|
|
|
|
|
part 'log_failure.freezed.dart';
|
|
|
|
|
|
|
|
|
|
@freezed
|
|
|
|
|
sealed class LogFailure with _$LogFailure, Failure {
|
|
|
|
|
const LogFailure._();
|
|
|
|
|
|
2023-12-01 12:56:24 +03:30
|
|
|
@With<UnexpectedFailure>()
|
2023-11-28 18:24:31 +03:30
|
|
|
const factory LogFailure.unexpected([
|
|
|
|
|
Object? error,
|
|
|
|
|
StackTrace? stackTrace,
|
|
|
|
|
]) = LogUnexpectedFailure;
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
({String type, String? message}) present(TranslationsEn t) {
|
|
|
|
|
return switch (this) {
|
|
|
|
|
LogUnexpectedFailure() => (
|
2023-12-01 12:56:24 +03:30
|
|
|
type: t.failure.unexpected,
|
2023-11-28 18:24:31 +03:30
|
|
|
message: null,
|
|
|
|
|
),
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|