ExternalLaunchException constructor

const ExternalLaunchException({
  1. required String action,
  2. required Uri uri,
  3. String? message,
  4. String? reason,
  5. Object? originalError,
  6. StackTrace? originalStackTrace,
})

Creates an exception for an external launch failure.

The action describes what was attempted and uri is the URL that failed. All other parameters are optional and provide additional context. If message is omitted, a generic user-friendly message is used.

Example:

throw ExternalLaunchException(
  action: 'navigate',
  uri: Uri.parse('https://maps.google.com?q=depot'),
  reason: 'No maps application installed',
);

Implementation

const ExternalLaunchException({required this.action, required this.uri, String? message, this.reason, this.originalError, this.originalStackTrace})
  : super(message: message ?? "Could not open the requested link. Please try again later.");