NavigationException constructor

NavigationException({
  1. required String route,
  2. required String operation,
  3. Object? arguments,
  4. String? userMessage,
  5. String? devMessage,
  6. Object? cause,
  7. StackTrace? stack,
  8. Map<String, dynamic> metadata = const {},
  9. Severity severity = Severity.warning,
  10. bool isReportable = false,
})

Creates a navigation exception, capturing the failed operation and route.

Implementation

NavigationException({
  required this.route,
  required this.operation,
  this.arguments,
  String? userMessage,
  String? devMessage,
  super.cause,
  super.stack,
  Map<String, dynamic> metadata = const {},
  super.severity = Severity.warning,
  super.isReportable = false,
}) : super(
        userMessage: userMessage ?? 'Navigation failed.',
        devMessage: devMessage ?? 'Navigation failed: $operation to $route',
        metadata: {
          'route': route,
          'operation': operation,
          if (arguments != null) 'arguments': arguments,
          ...metadata,
        },
      );