Skip to content

Commit ba52e46

Browse files
authored
Merge pull request #83 from ReSwift/mokagio/fix-fatal-error-messages
Provide more information on Routable fatalErrors
2 parents 02f8333 + 611d9a1 commit ba52e46

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

ReSwiftRouter/Routable.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,22 +34,22 @@ extension Routable {
3434
_ routeElementIdentifier: RouteElementIdentifier,
3535
animated: Bool,
3636
completionHandler: @escaping RoutingCompletionHandler) -> Routable {
37-
fatalError("This routable cannot change segments. You have not implemented it.")
37+
fatalError("This routable cannot push segments. You have not implemented it. (Asked \(type(of: self)) to push \(routeElementIdentifier))")
3838
}
3939

4040
public func popRouteSegment(
4141
_ routeElementIdentifier: RouteElementIdentifier,
4242
animated: Bool,
4343
completionHandler: @escaping RoutingCompletionHandler) {
44-
fatalError("This routable cannot change segments. You have not implemented it.")
44+
fatalError("This routable cannot pop segments. You have not implemented it. (Asked \(type(of: self)) to pop \(routeElementIdentifier))")
4545
}
4646

4747
public func changeRouteSegment(
4848
_ from: RouteElementIdentifier,
4949
to: RouteElementIdentifier,
5050
animated: Bool,
5151
completionHandler: @escaping RoutingCompletionHandler) -> Routable {
52-
fatalError("This routable cannot change segments. You have not implemented it.")
52+
fatalError("This routable cannot change segments. You have not implemented it. (Asked \(type(of: self)) to change from \(from) to \(to))")
5353
}
5454

5555
}

0 commit comments

Comments
 (0)