platform/lib/src/routing_exception.dart

14 lines
567 B
Dart
Raw Normal View History

2016-10-12 17:58:32 +00:00
abstract class RoutingException extends Exception {
factory RoutingException(String message) => new _RoutingExceptionImpl(message);
factory RoutingException.orphan() => new _RoutingExceptionImpl("Tried to resolve path '..' on a route that has no parent.");
factory RoutingException.noSuchRoute(String path) => new _RoutingExceptionImpl("Tried to navigate to non-existent route: '$path'.");
}
class _RoutingExceptionImpl implements RoutingException {
final String message;
_RoutingExceptionImpl(this.message);
@override
String toString() => message;
}