UnexpectedException constructor
UnexpectedException({})
Creates a catch-all exception when no specific domain type applies.
Implementation
UnexpectedException({
String? userMessage,
String? devMessage,
super.cause,
super.stack,
Map<String, dynamic> metadata = const {},
super.severity,
super.isReportable,
}) : super(
userMessage: userMessage ?? 'An unexpected error occurred.',
devMessage: devMessage ?? 'Unexpected error.',
metadata: {
'errorType': cause?.runtimeType.toString(),
'originalError': cause?.toString(),
...metadata,
},
);