From 22c59cc7a4541bd0fc7606f5712075979a40a603 Mon Sep 17 00:00:00 2001 From: Thomas Landauer Date: Thu, 22 Oct 2020 12:18:51 +0200 Subject: [PATCH] Update InnerBrowser.php Adding a hint to Symfony's exception message, see https://github.com/Codeception/Codeception/issues/5979 --- src/Codeception/Lib/InnerBrowser.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Codeception/Lib/InnerBrowser.php b/src/Codeception/Lib/InnerBrowser.php index f0c52e5..a1f8bca 100644 --- a/src/Codeception/Lib/InnerBrowser.php +++ b/src/Codeception/Lib/InnerBrowser.php @@ -600,7 +600,11 @@ public function dontSeeLink($text, $url = '') */ public function _getCurrentUri() { - return Uri::retrieveUri($this->getRunningClient()->getHistory()->current()->getUri()); + try { + return Uri::retrieveUri($this->getRunningClient()->getHistory()->current()->getUri()); + } catch (\LogicException $e) { + throw new \LogicException($e->getMessage() . ' Call `$I->amOnPage()` first.'); + } } public function seeInCurrentUrl($uri)