17 lines
412 B
Dart
17 lines
412 B
Dart
abstract class AppException implements Exception {
|
|
final String userMessage;
|
|
final String? technicalDetails;
|
|
final bool allowRetry;
|
|
|
|
const AppException({
|
|
required this.userMessage,
|
|
this.technicalDetails,
|
|
this.allowRetry = true,
|
|
});
|
|
|
|
@override
|
|
String toString() => technicalDetails == null
|
|
? '$runtimeType: $userMessage'
|
|
: '$runtimeType: $userMessage ($technicalDetails)';
|
|
}
|