blob: 045e2ea04d9233ce6ca5fb16030450fb37a86c7d [file] [log] [blame]
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import '../match.dart';
/// Thrown when [GoRouter] is used incorrectly.
class GoError extends Error {
/// Constructs a [GoError]
/// The error message.
final String message;
String toString() => 'GoError: $message';
/// A configuration error detected while processing redirects.
class RedirectionError extends Error implements UnsupportedError {
/// RedirectionError constructor.
RedirectionError(this.message, this.matches, this.location);
/// The matches that were found while processing redirects.
final List<RouteMatchList> matches;
final String message;
/// The location that was originally navigated to, before redirection began.
final Uri location;
String toString() => '${super.toString()} ${<String>[
.map((RouteMatchList routeMatches) => routeMatches.uri.toString()),
].join(' => ')}';